diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-04-26 14:58:56 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-04-26 14:58:56 +0000 |
commit | b6dd4eeb4d8c9a1791e8281a733175af8689757e (patch) | |
tree | 6258de9949c8df650186bcc36fa45ad7293dfa6c /nose/loader.py | |
parent | de05f5decb119181bc94b73d04c3d1199b990b01 (diff) | |
download | nose-b6dd4eeb4d8c9a1791e8281a733175af8689757e.tar.gz |
Changed getTestCaseNames to include runTest in test case case names if no other name selected -- 2.3 compat
Diffstat (limited to 'nose/loader.py')
-rw-r--r-- | nose/loader.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nose/loader.py b/nose/loader.py index aa6c99d..a18c5b3 100644 --- a/nose/loader.py +++ b/nose/loader.py @@ -55,6 +55,9 @@ class TestLoader(unittest.TestLoader): for case in self.getTestCaseNames(base): if case not in cases: cases.append(case) + # add runTest if nothing else picked + if not cases and hasattr(testCaseClass, 'runTest'): + cases = ['runTest'] if self.sortTestMethodsUsing: cases.sort(self.sortTestMethodsUsing) return cases @@ -333,6 +336,10 @@ class TestLoader(unittest.TestLoader): unittest.TestLoader.loadTestsFromNames(self, names, module) ]) return unittest.TestLoader.loadTestsFromNames(self, names, module) + +# def loadTestsFromTestCase(self, testCaseClass): +# names = self.getTestCaseNames(testCaseClass) + def loadTestsFromTestClass(self, cls): """Load tests from a test class that is *not* a unittest.TestCase |