No older revisions available
No older revisions available
~cpp
import unittest
from TestA import *
from TestB import *
class AllTests(unittest.TestSuite):
def suite(self):
suit = TestSuite()
suite.addTest(TestA())
suite.addTest(TestB())
return suit # 빼도 되더라..
# 사실 AllTests 자체를 완전히 빼버려도 됩니다. 그 이유는 from import *을 하기 때문입니다.
if __name__=='__main__':
unittest.main(argv=('','-v'))
혹은
~cpp
import unittest
def suite():
return unittest.defaultTestLoader.loadTestsFromNames( ('ThePackage.test_file1','ThePackage.subpack.test_file2'))
if __name__=='__main__':
unittest.TextTestRunner(verbosity=2).run(suite())
~cpp
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for test");
suite.addTestSuite(LoginTest.class);
suite.addTestSuite(QueryObjectTest.class);
return suite;
}
}