Use basestring instead of (str, str8) to test whether
cls is a module *name*.
This commit is contained in:
parent
c8c82333c6
commit
bf58bd6ddb
|
@ -534,7 +534,7 @@ def run_unittest(*classes):
|
||||||
valid_types = (unittest.TestSuite, unittest.TestCase)
|
valid_types = (unittest.TestSuite, unittest.TestCase)
|
||||||
suite = unittest.TestSuite()
|
suite = unittest.TestSuite()
|
||||||
for cls in classes:
|
for cls in classes:
|
||||||
if isinstance(cls, (str, str8)):
|
if isinstance(cls, basestring):
|
||||||
if cls in sys.modules:
|
if cls in sys.modules:
|
||||||
suite.addTest(unittest.findTestCases(sys.modules[cls]))
|
suite.addTest(unittest.findTestCases(sys.modules[cls]))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue