~jfb-tempo-consulting/unifield-wm/sync-env-py3

« back to all changes in this revision

Viewing changes to unittest27/loader.py

  • Committer: jf
  • Date: 2022-02-01 10:24:52 UTC
  • mfrom: (173.1.1 sync-env)
  • Revision ID: jfb@tempo-consulting.fr-20220201102452-rndr3uvmo030kqlf
[MERGE] US-9423: instance registration: do not validate an instance with no group on the sync server

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        testCaseNames = self.getTestCaseNames(testCaseClass)
63
63
        if not testCaseNames and hasattr(testCaseClass, 'runTest'):
64
64
            testCaseNames = ['runTest']
65
 
        loaded_suite = self.suiteClass(list(map(testCaseClass, testCaseNames)))
 
65
        loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
66
66
        return loaded_suite
67
67
 
68
68
    def loadTestsFromModule(self, module, use_load_tests=True):
78
78
        if use_load_tests and load_tests is not None:
79
79
            try:
80
80
                return load_tests(self, tests, None)
81
 
            except Exception as e:
 
81
            except Exception, e:
82
82
                return _make_failed_load_tests(module.__name__, e,
83
83
                                               self.suiteClass)
84
84
        return tests
144
144
                         prefix=self.testMethodPrefix):
145
145
            return attrname.startswith(prefix) and \
146
146
                hasattr(getattr(testCaseClass, attrname), '__call__')
147
 
        testFnNames = list(filter(isTestMethod, dir(testCaseClass)))
 
147
        testFnNames = filter(isTestMethod, dir(testCaseClass))
148
148
        if self.sortTestMethodsUsing:
149
149
            testFnNames.sort(key=_CmpToKey(self.sortTestMethodsUsing))
150
150
        return testFnNames
296
296
                else:
297
297
                    try:
298
298
                        yield load_tests(self, tests, pattern)
299
 
                    except Exception as e:
 
299
                    except Exception, e:
300
300
                        yield _make_failed_load_tests(package.__name__, e,
301
301
                                                      self.suiteClass)
302
302