Created
September 20, 2015 13:42
-
-
Save rafaelhenrique/3e17948daf48dffbc18a to your computer and use it in GitHub Desktop.
Run unittests from other module http://stackoverflow.com/questions/15334042/python-unittesting-run-tests-in-another-module
This file contains 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
from tests import testentities | |
import unittest | |
def suite(): | |
suite = unittest.TestSuite() | |
suite.addTest(testentities.suite()) | |
return suite | |
if __name__ == "__main__": | |
unittest.main(defaultTest='suite') |
This file contains 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 TestClient(unittest.TestCase): | |
def test_valid(self): | |
self.assertTrue(True) | |
def test_invalid(self): | |
self.assertTrue(False) | |
def suite(): | |
suite = unittest.TestSuite() | |
suite.addTest(unittest.makeSuite(TestClient, 'test')) | |
return suite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment