Skip to content

Commit

Permalink
unittest: Allow passing module name or instance into unittest.main()
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewleech committed Nov 1, 2018
1 parent 72cbefb commit 5e10ff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unittest/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def test_cases(m):
if isinstance(c, object) and isinstance(c, type) and issubclass(c, TestCase):
yield c

m = __import__(module)
m = __import__(module) if isinstance(module, str) else module
suite = TestSuite()
for c in test_cases(m):
suite.addTest(c)
Expand Down

0 comments on commit 5e10ff5

Please sign in to comment.