Skip to content

Commit 49595ea

Browse files
authored
Merge pull request #486 from priyacshah/junit_early_exit_fix
Fix for junit failure while using with --early-exit FIX #485
2 parents acae639 + db6ee1a commit 49595ea

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55
## [Unreleased]
66

77
*Stay tuned...*
8+
### Fixed
9+
- Fix junit when using --early-exit
810

911
## [v0.18.1]
1012

radish/extensions/junit_xml_writer.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,17 @@ def generate_junit_xml(self, features, marker):
127127
if not scenario.has_to_run(world.config.scenarios):
128128
continue
129129

130-
testcase_element = etree.Element(
131-
"testcase",
132-
classname=feature.sentence,
133-
name=scenario.sentence,
134-
time="%.3f" % scenario.duration.total_seconds(),
135-
)
130+
if scenario.state not in [
131+
Step.State.UNTESTED,
132+
Step.State.PENDING,
133+
Step.State.SKIPPED,
134+
]:
135+
testcase_element = etree.Element(
136+
"testcase",
137+
classname=feature.sentence,
138+
name=scenario.sentence,
139+
time="%.3f" % scenario.duration.total_seconds(),
140+
)
136141

137142
if world.config.junit_relaxed:
138143
properties_element = etree.Element("properties")

0 commit comments

Comments
 (0)