Commit 0769148b authored by Romain Courteaud's avatar Romain Courteaud

loadTestsFromNames create new loader instance. Filter parameter is not

propagated, as it is not part of standard API.
Restore class variable modification, but clean it as soon as the suite has been
created.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41880 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2bc847bb
......@@ -470,8 +470,11 @@ def runLiveTest(test_list, verbosity=1, stream=None, **kw):
loader = ERP5TypeTestLoader()
run_only = kw.get('run_only', None)
if run_only is not None:
loader.filter_test_list = [re.compile(x).search for x in run_only.split(',')]
ERP5TypeTestLoader.filter_test_list = \
[re.compile(x).search for x in run_only.split(',')]
suite = loader.loadTestsFromNames(test_list)
if run_only is not None:
ERP5TypeTestLoader.filter_test_list = None
output = stream
if stream is None:
output = StringIO()
......
......@@ -508,10 +508,12 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
TestRunner = DebugTextTestRunner
loader = ERP5TypeTestLoader()
if run_only:
loader.filter_test_list = [re.compile(x).search for x in
ERP5TypeTestLoader.filter_test_list = [re.compile(x).search for x in
run_only.split(',')]
suite = loader.loadTestsFromNames(test_list)
if run_only:
ERP5TypeTestLoader.filter_test_list = None
if not isinstance(Storage, ClientStorage):
# Remove nodes that were registered during previous execution.
......
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