when specifying classes in the test list, use a testClass from the reloaded...

when specifying classes in the test list, use a testClass from the reloaded module, not from the old one

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44393 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 04c5f72e
...@@ -131,6 +131,9 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin): ...@@ -131,6 +131,9 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
from Products.ERP5Type.tests.runUnitTest import ERP5TypeTestLoader from Products.ERP5Type.tests.runUnitTest import ERP5TypeTestLoader
class ERP5TypeTestReLoader(ERP5TypeTestLoader): class ERP5TypeTestReLoader(ERP5TypeTestLoader):
"""ERP5Type test re-loader supports reloading test modules before
running them.
"""
def __init__(self, filter_test_list=()): def __init__(self, filter_test_list=()):
super(ERP5TypeTestReLoader, self).__init__() super(ERP5TypeTestReLoader, self).__init__()
...@@ -153,14 +156,12 @@ class ERP5TypeTestReLoader(ERP5TypeTestLoader): ...@@ -153,14 +156,12 @@ class ERP5TypeTestReLoader(ERP5TypeTestLoader):
ERP5TypeTestLoader.filter_test_list = old_filter_test_list ERP5TypeTestLoader.filter_test_list = old_filter_test_list
def loadTestsFromModule(self, module): def loadTestsFromModule(self, module):
"""ERP5Type test re-loader supports reloading test modules before
running them.
"""
reload(module) reload(module)
return super(ERP5TypeTestReLoader, self).loadTestsFromModule(module) return super(ERP5TypeTestReLoader, self).loadTestsFromModule(module)
def loadTestsFromTestCase(self, testCaseClass): def loadTestsFromTestCase(self, testCaseClass):
reload(sys.modules[testCaseClass.__module__]) testModule = reload(sys.modules[testCaseClass.__module__])
testCaseClass = getattr(testModule, testCaseClass.__name__)
return super(ERP5TypeTestReLoader, return super(ERP5TypeTestReLoader,
self).loadTestsFromTestCase(testCaseClass) self).loadTestsFromTestCase(testCaseClass)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment