Always use clean line for description

This commit is contained in:
Patrick Barna 2023-02-16 12:16:33 -07:00
parent ce87c51380
commit eff9bfa566
2 changed files with 2 additions and 3 deletions

View File

@ -147,7 +147,7 @@ def parse_feature(basedir: str, filename: str, encoding: str = "utf-8") -> Featu
elif prev_mode == types.FEATURE: elif prev_mode == types.FEATURE:
# Do not include comments in descriptions # Do not include comments in descriptions
if not stripped_line.startswith("#"): if not stripped_line.startswith("#"):
description.append(line) description.append(clean_line)
else: else:
raise exceptions.FeatureError( raise exceptions.FeatureError(
"Multiple features are not allowed in a single feature file", "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
# Do not include comments in descriptions # Do not include comments in descriptions
if stripped_line.startswith("#"): if stripped_line.startswith("#"):
continue continue
scenario.add_description_line(line) scenario.add_description_line(clean_line)
continue continue
tags = get_tags(prev_line) tags = get_tags(prev_line)
scenario = ScenarioTemplate( scenario = ScenarioTemplate(

View File

@ -19,7 +19,6 @@ def test_description(pytester):
Some description goes here. Some description goes here.
Scenario: Description Scenario: Description
Also, the scenario can have a description. Also, the scenario can have a description.
It goes here between the scenario name It goes here between the scenario name