You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test Junkie version pip show test_junkie -----Version: 0.8a6
Platform aka Windows 10 or Linux Mint 18.1 ---Linux
Command used, if running via terminal ---python3 Runner.py
Smallest code snippet that can reproduce the issue and /or description of the issue
.local/lib/python3.10/site-packages/test_junkie/metrics.py", line 179, in get_basic_report
report["tests"][param_data["status"]] += 1
KeyError: None
Expected behavior
The code shoud returne the report
Actual behavior
KeyError: None
PATH: venv/lib/python3.10/site-packages/test_junkie/metrics.py line 156
There is the code to fix the error
report = {"tests": get_template(),
"suites": defaultdict(get_template)}
for suite in self.__executed_suites:
for test in suite.get_test_objects():
test_metrics = test.metrics.get_metrics()
for class_param, class_param_data in test_metrics.items():
for param, param_data in class_param_data.items():
report["tests"]["total"] += 1
if param_data["status"] is not None:
report["tests"][param_data["status"]] += 1
report["suites"][suite]["total"] += 1
report["suites"][suite][param_data["status"]] += 1
return report
`
The text was updated successfully, but these errors were encountered:
@Rdvp1514 I just looked at the code. Looks like you are getting a None value from param_data["status"], which should not be None. So the issue is somewhere else, not in the get_basic_report function. It would be helpful if you can provide the code that you run to repro this.
python --version
----V3.10pip show test_junkie
-----Version: 0.8a6.local/lib/python3.10/site-packages/test_junkie/metrics.py", line 179, in get_basic_report
report["tests"][param_data["status"]] += 1
KeyError: None
Expected behavior
The code shoud returne the report
Actual behavior
KeyError: None
PATH: venv/lib/python3.10/site-packages/test_junkie/metrics.py line 156
There is the code to fix the error
`
from collections import defaultdict
def get_basic_report(self):
def get_template():
return {"total": 0,
TestCategory.SUCCESS: 0,
TestCategory.FAIL: 0,
TestCategory.ERROR: 0,
TestCategory.IGNORE: 0,
TestCategory.SKIP: 0,
TestCategory.CANCEL: 0}
`
The text was updated successfully, but these errors were encountered: