diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-04-15 13:38:17 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-04-15 13:38:17 +0000 |
commit | 699b36ea735545b9b9c54afe54bffacc5b62ca4a (patch) | |
tree | 109951bc4c7957ad963d8e6ebf3572802575cb5c /nose/loader.py | |
parent | 52740642a537610a1aaa803b4f88a279ea23dcc6 (diff) | |
download | nose-699b36ea735545b9b9c54afe54bffacc5b62ca4a.tar.gz |
About to being removed parent arg from context suite factory
Diffstat (limited to 'nose/loader.py')
-rw-r--r-- | nose/loader.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nose/loader.py b/nose/loader.py index c3edb0a..ca0c9ba 100644 --- a/nose/loader.py +++ b/nose/loader.py @@ -9,7 +9,7 @@ from nose.importer import Importer, add_path, remove_path from nose.selector import defaultSelector, TestAddress from nose.util import cmp_lineno, getpackage, isgenerator, ispackage, \ resolve_name -from suite import LazySuite, ContextSuiteFactory +from suite import ContextSuiteFactory log = logging.getLogger(__name__) @@ -114,7 +114,7 @@ class TestLoader(unittest.TestLoader): entry_path, discovered=True) elif is_test: # Another test dir in this one: recurse lazily - yield LazySuite( + yield self.suiteClass( lambda: self.loadTestsFromDir(entry_path)) # give plugins a chance try: @@ -203,6 +203,11 @@ class TestLoader(unittest.TestLoader): return self.suiteClass(generate) def loadTestsFromModule(self, module, discovered=False): + """Load all tests from module and return a suite containing + them. If the module has been discovered and is not test-like, + the suite will be empty by default, though plugins may add + their own tests. + """ log.debug("Load from module %s", module) tests = [] test_classes = [] @@ -303,7 +308,7 @@ class TestLoader(unittest.TestLoader): # also know that we're not going to be asked # to load from . and ./some_module.py *as part # of this named test load* - return LazySuite( + return self.suiteClass( lambda: self.loadTestsFromDir(path)) elif os.path.isfile(path): return self.loadTestsFromFile(path) |