Created
December 13, 2012 06:44
-
-
Save santiycr/4274570 to your computer and use it in GitHub Desktop.
Run python unit tests from a different python script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| import test_example | |
| unittest.main(module=test_example) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| class myTest(unittest.TestCase): | |
| def test_dummy(self): | |
| assert True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If changing
sys.argvis not an option, one can useunittest.TextTestRunneras described in this StackOverflow answer. IMHO, that's a more convenient way.