Ejemplo n.º 1
0
 def __init__(self, testModule):
     warnings.warn("DocTestSuite is deprecated in Twisted 8.0.",
                   category=DeprecationWarning, stacklevel=2)
     TestSuite.__init__(self)
     suite = doctest.DocTestSuite(testModule)
     for test in suite._tests: #yay encapsulation
         self.addTest(ITestCase(test))
Ejemplo n.º 2
0
 def __init__(self, testModule):
     warnings.warn("DocTestSuite is deprecated in Twisted 8.0.",
                   category=DeprecationWarning,
                   stacklevel=2)
     TestSuite.__init__(self)
     suite = doctest.DocTestSuite(testModule)
     for test in suite._tests:  #yay encapsulation
         self.addTest(ITestCase(test))
Ejemplo n.º 3
0
 def run(self, result):
     try:
         TestSuite.run(self, result)
     finally:
         self._bail()
Ejemplo n.º 4
0
 def run(self, result):
     try:
         TestSuite.run(self, result)
     finally:
         self._bail()
Ejemplo n.º 5
0
            print "deleted %s/" % dir
    #os.rmdir(root)
    print "deleted %s/" % root

if __name__ == '__main__':
    status = 0
    workingDir = tempfile.mkdtemp('', 'testtool.', '/tmp')
    try:
        print ""
        print "workingDir = %s" % workingDir
        fixtureDir = os.path.join(os.getcwd(), 'fixtures')
        print "fixtureDir = %s" % fixtureDir
        print ""

        runner = TrialRunner(VerboseTextReporter, workingDirectory=workingDir)
        suite = TestSuite()

        # find all tests
        print "searching for test cases ..."
        loader = TestLoader()
        for root,dirs,files in os.walk('.'):
            for name in files:
                if name.startswith('test_') and name.endswith('.py'):
                    module = loader.findByName(os.path.join(root,name))
                    classes = loader.findTestClasses(module)
                    if len(classes) > 0:
                        for cls in classes:
                            methods = loader.getTestCaseNames(cls)
                            if len(methods) > 0:
                                for method in methods:
                                    methodName = loader.methodPrefix + method
Ejemplo n.º 6
0
def testSuite():
    loader = TestLoader()
    return TestSuite(
        list(
            loader.loadModule(namedModule(module))
            for module in PORTED_TEST_MODULES))