File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -332,19 +332,27 @@ def run_one(m):
332
332
# raise
333
333
finally :
334
334
tear_down ()
335
- o .doCleanups ()
335
+ try :
336
+ o .doCleanups ()
337
+ except AttributeError :
338
+ pass
336
339
337
340
if hasattr (o , "runTest" ):
338
341
name = str (o )
339
342
run_one (o .runTest )
340
343
return
341
344
342
345
for name in dir (o ):
343
- if name .startswith ("test " ):
346
+ if name .startswith ("test_ " ):
344
347
m = getattr (o , name )
345
348
if not callable (m ):
346
349
continue
347
350
run_one (m )
351
+
352
+ if callable (o ):
353
+ name = o .__name__
354
+ run_one (o )
355
+
348
356
return exceptions
349
357
350
358
@@ -354,6 +362,8 @@ def test_cases(m):
354
362
c = getattr (m , tn )
355
363
if isinstance (c , object ) and isinstance (c , type ) and issubclass (c , TestCase ):
356
364
yield c
365
+ elif tn .startswith ("test_" ) and callable (c ):
366
+ yield c
357
367
358
368
m = __import__ (module ) if isinstance (module , str ) else module
359
369
suite = TestSuite (m .__name__ )
You can’t perform that action at this time.
0 commit comments