diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-03-03 04:20:14 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-03-03 04:20:14 +0000 |
commit | 094a47dca4c25b190d79e65a4f2c7d8515e98220 (patch) | |
tree | 6659140eeec36d542d3715608293478e67878d2c /unit_tests/test_loader.py | |
parent | a588d4ed45713af27e35f4791cd2de7543638991 (diff) | |
download | nose-094a47dca4c25b190d79e65a4f2c7d8515e98220.tar.gz |
Implemented first draft support for class-level fixtures.
Diffstat (limited to 'unit_tests/test_loader.py')
-rw-r--r-- | unit_tests/test_loader.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/unit_tests/test_loader.py b/unit_tests/test_loader.py index 4b90614..4c2f7b3 100644 --- a/unit_tests/test_loader.py +++ b/unit_tests/test_loader.py @@ -7,6 +7,7 @@ from nose.loader import TestLoader # FIXME replace with nose importer eventually from nose import loader # so we can set its __import__ from nose import fixture # so we can set its __import__ +from nose import util # so we can set its __import__ import nose.case # @@ -85,7 +86,9 @@ def test_func_generator_name(): def try_odd(v): assert v % 2 - + +M['nose'] = nose +M['__main__'] = sys.modules['__main__'] M['test_module'].TC = TC TC.__module__ = 'test_module' M['test_module'].test_func = test_func @@ -107,6 +110,8 @@ del test_func del TestClass del test_func_generator +# sys.modules.update(M) + # Mock the filesystem access so we don't have to maintain # a support dir with real files _listdir = os.listdir @@ -168,13 +173,13 @@ class TestTestLoader(unittest.TestCase): os.listdir = mock_listdir os.path.isdir = mock_isdir os.path.isfile = mock_isfile - loader.__import__ = fixture.__import__ = mock_import + loader.__import__ = fixture.__import__ = util.__import__ = mock_import def tearDown(self): os.listdir = _listdir os.path.isdir = _isdir os.path.isfile = _isfile - loader.__import__ = fixture.__import__ = __import__ + loader.__import__ = fixture.__import__ = util.__import__ = __import__ def test_lint(self): """Test that main API functions exist |