From ebe59a7b6e958fa5334f81d41cc02aeb6749cb1c Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 17 Aug 2025 14:34:38 +0200 Subject: [PATCH] removed support for multiple interpreters --- run.py | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/run.py b/run.py index 5c255d1..af447ce 100644 --- a/run.py +++ b/run.py @@ -257,29 +257,26 @@ def unittest_testrun(ut_folder, options): # execution_level = report.TCEL_REVERSE_NAMED.get(options.execution_level, report.TCEL_FULL) # - if sys.version_info.major in config.lib.__INTERPRETER__: - output.print_header("Running \"%s\" Unittest with %s" % (options.execution_level, interpreter_version)) - with open(testresults_filename(ut_folder, FN_DATA_COLLECTION), 'r') as fh: - data_collection = json.loads(fh.read()) - output.print_action('Executing Testcases') - heading_dict = {} - for key in data_collection[jsonlog.MAIN_KEY_SPECIFICATION].get(jsonlog.SPEC_ITEM_DICT, {}): - heading_dict[key] = data_collection[jsonlog.MAIN_KEY_SPECIFICATION][jsonlog.SPEC_ITEM_DICT][key]['Heading'] - test_session = report.testSession( - ['__unittest__', 'root', config.lib.__name__], - interpreter=interpreter_version, - testcase_execution_level=execution_level, - testrun_id='p%d' % sys.version_info[0], - heading_dict=heading_dict - ) - tests.testrun(test_session) - # - output.print_action('Adding Testrun data to %s' % testresults_filename(ut_folder, FN_DATA_COLLECTION)) - data_collection[jsonlog.MAIN_KEY_TESTRUNS].append(test_session) - with open(testresults_filename(ut_folder, FN_DATA_COLLECTION), 'w') as fh: - fh.write(json.dumps(data_collection, indent=4, sort_keys=True)) - else: - output.print_header("Library does not support %s." % interpreter_version) + output.print_header("Running \"%s\" Unittest with %s" % (options.execution_level, interpreter_version)) + with open(testresults_filename(ut_folder, FN_DATA_COLLECTION), 'r') as fh: + data_collection = json.loads(fh.read()) + output.print_action('Executing Testcases') + heading_dict = {} + for key in data_collection[jsonlog.MAIN_KEY_SPECIFICATION].get(jsonlog.SPEC_ITEM_DICT, {}): + heading_dict[key] = data_collection[jsonlog.MAIN_KEY_SPECIFICATION][jsonlog.SPEC_ITEM_DICT][key]['Heading'] + test_session = report.testSession( + ['__unittest__', 'root', config.lib.__name__], + interpreter=interpreter_version, + testcase_execution_level=execution_level, + testrun_id='p%d' % sys.version_info[0], + heading_dict=heading_dict + ) + tests.testrun(test_session) + # + output.print_action('Adding Testrun data to %s' % testresults_filename(ut_folder, FN_DATA_COLLECTION)) + data_collection[jsonlog.MAIN_KEY_TESTRUNS].append(test_session) + with open(testresults_filename(ut_folder, FN_DATA_COLLECTION), 'w') as fh: + fh.write(json.dumps(data_collection, indent=4, sort_keys=True)) def unittest_finalise(ut_folder):