From fbf70a35a2e72c010cc683068c214f11f7bdecda Mon Sep 17 00:00:00 2001 From: hpk Date: Thu, 2 Apr 2009 15:33:14 +0200 Subject: [PATCH] [svn r63540] fixing shallow test bugs --HG-- branch : trunk --- py/test/plugin/pytest_resultdb.py | 3 +++ py/test/testing/test_config.py | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-) 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])