[Piglit] [PATCH 42/42] json_backend_tests.py: use utils instead of raise AssertionError

Dylan Baker baker.dylan.c at gmail.com
Wed Apr 22 15:10:31 PDT 2015


Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/tests/json_backend_tests.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/framework/tests/json_backend_tests.py b/framework/tests/json_backend_tests.py
index c3f11fe..d5fea31 100644
--- a/framework/tests/json_backend_tests.py
+++ b/framework/tests/json_backend_tests.py
@@ -76,13 +76,11 @@ class TestJSONTestMethod(utils.StaticDirectory):
         """backends.json.JSONBackend.write_test(): adds tests to a 'tests' directory"""
         assert os.path.exists(os.path.join(self.tdir, 'tests', '0.json'))
 
+    @utils.no_error
     def test_json_is_valid(self):
         """backends.json.JSONBackend.write_test(): produces valid json"""
         with open(os.path.join(self.tdir, 'tests', '0.json'), 'r') as f:
-            try:
-                json.load(f)
-            except Exception as e:
-                raise AssertionError(e)
+            json.load(f)
 
     def test_json_is_correct(self):
         """backends.json.JSONBackend.write_test(): produces correct json"""
@@ -120,13 +118,11 @@ class TestJSONTestFinalize(utils.StaticDirectory):
         """backends.json.JSONBackend.finalize(): creates a results.json file"""
         assert os.path.exists(os.path.join(self.tdir, 'results.json'))
 
+    @utils.no_error
     def test_results_valid(self):
         """backends.json.JSONBackend.finalize(): results.json is valid"""
         with open(os.path.join(self.tdir, 'results.json'), 'r') as f:
-            try:
-                json.load(f)
-            except Exception as e:
-                raise AssertionError(e)
+            json.load(f)
 
 
 def test_update_results_current():
-- 
2.3.5



More information about the Piglit mailing list