Required mock package for python < 3.3.

It was required for the commit:
1208206bc0

Also, do not fetch the scenario-name, when it is not avaiable (but - use
default vaule as the stringified test-case itself).
This commit is contained in:
Ashesh Vashi 2017-06-13 15:41:58 +05:30
parent a9ce9c9717
commit 903389d7b7
2 changed files with 7 additions and 4 deletions

View File

@ -40,4 +40,5 @@ SQLAlchemy==1.0.14
sqlparse==0.1.19
Werkzeug==0.9.6
WTForms==2.0.2
backports.csv==1.0.4; python_version <= '2.7'
backports.csv==1.0.4; python_version <= '2.7'
mock===2.0.0; python_version < '3.3'

View File

@ -223,13 +223,15 @@ def update_test_result(test_cases, test_result_dict):
"""
for test_case in test_cases:
test_class_name = test_case[0].__class__.__name__
test_scenario_name = getattr(
test_case[0], 'scenario_name', str(test_case[0])
)
if test_class_name in test_result_dict:
test_result_dict[test_class_name].append(
{test_case[0].scenario_name: test_case[1]})
{test_scenario_name: test_case[1]})
else:
test_result_dict[test_class_name] = \
[{test_case[0].scenario_name: test_case[
1]}]
[{test_scenario_name: test_case[1]}]
def get_tests_result(test_suite):