Skip to content

Commit 4d5cc90

Browse files
committed
Improved output when scenarios fail
1 parent 9e90609 commit 4d5cc90

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

test/tck/environment.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,41 @@
2020

2121
from test.tck import tck_util
2222

23+
failing_features = {}
24+
2325

2426
def before_all(context):
2527
context.config.setup_logging()
2628

2729

2830
def before_feature(context, feature):
2931
# Workaround. Behave has a different way of tagging than cucumber
30-
if "reset_database" in feature.tags:
31-
for scenario in feature.scenarios:
32-
scenario.tags.append("reset_database")
32+
for scenario in feature.scenarios:
33+
scenario.tags += feature.tags
3334

3435

3536
def before_scenario(context, scenario):
3637
if "reset_database" in scenario.tags:
3738
tck_util.send_string("MATCH (n) DETACH DELETE n")
39+
if "equality_test" in scenario.tags:
40+
context.values = {}
41+
42+
43+
def after_feature(context, feature):
44+
failed_scenarios = []
45+
for scenario in feature.scenarios:
46+
if scenario.status != "passed":
47+
failed_scenarios.append(scenario.name)
48+
if len(failed_scenarios) > 0:
49+
failing_features[feature.name] = failed_scenarios
50+
51+
52+
def after_all(context):
53+
if len(failing_features) != 0:
54+
print("Following Features failed in TCK:")
55+
for feature, list_of_scenarios in failing_features.items():
56+
print("Feature: %s" %feature)
57+
for scenario in list_of_scenarios:
58+
print("Failing scenario: %s" % scenario)
59+
raise Exception("TCK FAILED!")
60+

0 commit comments

Comments
 (0)