diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-04-21 04:26:05 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-04-21 04:26:05 +0000 |
commit | fd7f96c07097e1544845d7fe6706ac13e7490bd2 (patch) | |
tree | 553cf38b49728a734d1f27a589b059e26657b7dc /nose/loader.py | |
parent | de9924c8790aa4dcc4bf9cdeac744a1d6029709e (diff) | |
download | nose-fd7f96c07097e1544845d7fe6706ac13e7490bd2.tar.gz |
Work on integrating doctest and testid plugins; doctest still needs some work to provide correct information to rest of system when individual tests are loaded.
Diffstat (limited to 'nose/loader.py')
-rw-r--r-- | nose/loader.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/nose/loader.py b/nose/loader.py index b2ee657..d9bcd44 100644 --- a/nose/loader.py +++ b/nose/loader.py @@ -254,7 +254,6 @@ class TestLoader(unittest.TestLoader): if addr.call: name = addr.call parent, obj = self.resolve(name, module) - print parent, obj return suite(ContextList([self.makeTest(obj, parent)], context=parent)) else: @@ -357,6 +356,16 @@ class TestLoader(unittest.TestLoader): instance that can be run as a test. """ log.debug('Make test for %s parent: %s', obj, parent) + + # plugins get first crack + plug_tests = [] + try: + for test in self.config.plugins.makeTest(obj, parent): + plug_tests.append(test) + if plug_tests: + return self.suiteClass(plug_tests) + except (TypeError, AttributeError): + pass if isinstance(obj, unittest.TestCase): return obj elif isclass(obj): @@ -380,15 +389,10 @@ class TestLoader(unittest.TestLoader): else: return FunctionTestCase(obj) else: - # give plugins a chance - plug_test = self.config.plugins.makeTest(obj, parent) - if plug_test is not None: - return plug_test return Failure(TypeError, "Can't make a test from %s" % obj) def resolve(self, name, module): - print "resolve name %s in module %s" % (name, module) obj = module parts = name.split('.') for part in parts: |