Skip to content

Commit eff9bfa

Browse files
committed
Always use clean line for description
1 parent ce87c51 commit eff9bfa

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/pytest_bdd/parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def parse_feature(basedir: str, filename: str, encoding: str = "utf-8") -> Featu
147147
elif prev_mode == types.FEATURE:
148148
# Do not include comments in descriptions
149149
if not stripped_line.startswith("#"):
150-
description.append(line)
150+
description.append(clean_line)
151151
else:
152152
raise exceptions.FeatureError(
153153
"Multiple features are not allowed in a single feature file",
@@ -169,7 +169,7 @@ def parse_feature(basedir: str, filename: str, encoding: str = "utf-8") -> Featu
169169
# Do not include comments in descriptions
170170
if stripped_line.startswith("#"):
171171
continue
172-
scenario.add_description_line(line)
172+
scenario.add_description_line(clean_line)
173173
continue
174174
tags = get_tags(prev_line)
175175
scenario = ScenarioTemplate(

tests/feature/test_description.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def test_description(pytester):
1919
Some description goes here.
2020
2121
Scenario: Description
22-
2322
Also, the scenario can have a description.
2423
2524
It goes here between the scenario name

0 commit comments

Comments
 (0)