diff --git a/py/test/plugin/pytest_resultdb.py b/py/test/plugin/pytest_resultdb.py index 2b1be0123..9cbbaa479 100644 --- a/py/test/plugin/pytest_resultdb.py +++ b/py/test/plugin/pytest_resultdb.py @@ -276,6 +276,9 @@ class BaseResultArchiveTests(object): class TestJSONResultArchive(BaseResultArchiveTests): cls = JSONResultArchive + def setup_method(self, method): + py.test.importorskip("simplejson") + class TestSQLiteResultArchive(BaseResultArchiveTests): cls = SQLiteResultArchive diff --git a/py/test/testing/test_config.py b/py/test/testing/test_config.py index 25f410d99..3d9076446 100644 --- a/py/test/testing/test_config.py +++ b/py/test/testing/test_config.py @@ -55,13 +55,9 @@ class TestConfigCmdlineParsing: type="int", dest="gdest", help="g value."), ) """) - old = testdir.chdir() - try: - py.test.raises(ValueError, """ - py.test.config._reparse(['-g', '17']) - """) - finally: - old.chdir() + py.test.raises(ValueError, """ + py.test.config._reparse(['-g', '17']) + """) def test_parsing_again_fails(self, tmpdir): config = py.test.config._reparse([tmpdir])