We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
"""
1 parent 34bc885 commit 4a39fd3Copy full SHA for 4a39fd3
pytest_bdd/feature.py
@@ -545,7 +545,17 @@ def add_line(self, line):
545
@property
546
def name(self):
547
"""Get step name."""
548
- lines = [self._name] + ([textwrap.dedent("\n".join(self.lines))] if self.lines else [])
+ multilines_content = textwrap.dedent("\n".join(self.lines)) if self.lines else ""
549
+
550
+ # Remove the multiline quotes, if present.
551
+ multilines_content = re.sub(
552
+ pattern=r'^"""\n(?P<content>.*)\n"""$',
553
+ repl=r'\g<content>',
554
+ string=multilines_content,
555
+ flags=re.DOTALL, # Needed to make the "." match also new liness
556
+ )
557
558
+ lines = [self._name] + [multilines_content]
559
return "\n".join(lines).strip()
560
561
@name.setter
0 commit comments