Python TestSuite会泄漏内存吗?

时间:2014-02-07 12:14:23

标签: python python-2.7 memory-leaks python-unittest

我独立运行3个Python UnitTest模块而没有任何问题。但当我将它们打包成TestSuite时,测试会随意挂起。 TestSuite会消耗更多内存吗?还是泄漏记忆?

import unittest   
from testConfigurationLLC import testConfigurationLLC
from testRecordAllergyDataInOPPart1Of2 import testRecordAllergyDataInOPPart1Of2
from testRecordAllergyDataInOPPart2Of2 import testRecordAllergyDataInOPPart2Of2


class ConfigTestCase(unittest.TestCase):
    def setUp(self):
        print 'stp'
        ##set up code

    def runTest(self):

        #runs test
        print 'stp'

def suite():
    """
        Gather all the tests from this module in a test suite.
    """
    test_suite = unittest.TestSuite()
    test_suite.addTest(testConfigurationLLC('testConfigurationLLC'))
    test_suite.addTest(testRecordAllergyDataInOPPart1Of2('testRecordAllergyDataInOPPart1Of2'))
    test_suite.addTest(testRecordAllergyDataInOPPart2Of2('testRecordAllergyDataInOPPart2Of2'))
    return test_suite

mySuit=suite()


runner=unittest.TextTestRunner()
runner.run(mySuit)

0 个答案:

没有答案