Repository navigation
Support Markdown with Gherkin feature files - #857
Open
LucasGois1 wants to merge 1 commit into
Open
LucasGois1 wants to merge 1 commit into
LucasGois1 wants to merge 1 commit into
Conversation
Parse files ending in .md with the official Markdown token matcher and collect *.feature.md files from directories next to *.feature files. gherkin-official releases before 32.2.0 crash on any Markdown document, so those releases raise FeatureError for Markdown files instead. Closes pytest-dev#780
LucasGois1
force-pushed
the
feat/markdown-with-gherkin
branch
from
November 3, 2026 02:51
585f968 to
d41eae7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Problem statement
Closes #780.
gherkin-officialalready ships a Markdown with Gherkin (MDG) token matcher, but pytest-bdd cannot use it:*.featurefiles.As a result,
.feature.mdfiles cannot be used.🛠️ What's changed
.mdare parsed withGherkinInMarkdownTokenMatcher.scenarios()also collects*.feature.mdfiles from directories. Other Markdown files, such asREADME.md, are not collected.The rest of the pipeline does not change, because MDG produces the same Gherkin document as a
.featurefile.Older
gherkin-officialreleases. Before 32.2.0, the Python Markdown matcher crashes on any MDG document, including a minimal one:I reproduced this with 29.0.0, 32.0.1 and 32.1.0 through 32.1.2. Version 32.2.0 parses correctly.
I kept the existing
>=29.0.0dependency range. With an older release, a Markdown file raisesFeatureErrornaming the minimum version instead of crashing. If you would rather raise the floor to 32.2.0 and drop the check, I can do that.✅ Checklist
I have added an entry to
CHANGES.rst.The changes are covered by tests. The new
tests/feature/test_markdown.pycovers:.featurefiles, withREADME.mdignored;@scenariobinding a scenario by name;Results on Python 3.14:
ruffandmypypass with gherkin-official 42.0.1.I have updated the documentation where necessary. The README gains a short "Markdown with Gherkin" section, including two MDG rules that surprise people:
`@slow`in a prose line is read as a tag line.