We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d747b21 commit f09d2ecCopy full SHA for f09d2ec
python-stdlib/unittest/unittest.py
@@ -180,7 +180,7 @@ class TestRunner:
180
def run(self, suite):
181
res = TestResult()
182
for c in suite._tests:
183
- res.exceptions.extend(run_class(c, res))
+ res.exceptions.extend(run_suite(c, res))
184
185
print("Ran %d tests\n" % res.testsRun)
186
if res.failuresNum > 0 or res.errorsNum > 0:
@@ -216,8 +216,11 @@ def capture_exc(e):
216
217
218
# TODO: Uncompliant
219
-def run_class(c, test_result):
220
- o = c()
+def run_suite(c, test_result):
+ if isinstance(c, type):
221
+ o = c()
222
+ else:
223
+ o = c
224
set_up = getattr(o, "setUp", lambda: None)
225
tear_down = getattr(o, "tearDown", lambda: None)
226
exceptions = []
0 commit comments