Conversation
…n pytest-bdd. Bump the minimum supported version of gherkin-official to v30 to support this and remove the warnings in python 3.13+
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #759 +/- ##
==========================================
- Coverage 96.05% 95.34% -0.71%
==========================================
Files 55 53 -2
Lines 2359 2193 -166
Branches 136 157 +21
==========================================
- Hits 2266 2091 -175
- Misses 56 60 +4
- Partials 37 42 +5 ☔ View full report in Codecov by Sentry. |
| def _to_raw_string(normal_string: str) -> str: | ||
| return normal_string.replace("\\", "\\\\") | ||
| def replace_datatable_values(document: GherkinDocument) -> None: | ||
| """Replace all cell values in DataTables within a GherkinDocument using _to_raw_string.""" |
There was a problem hiding this comment.
why is this necessary? Maybe it should be done by gherkin-official?
There was a problem hiding this comment.
also, I'd rather avoid trying to patch datatables here at all, and instead handle it in src/pytest_bdd/scenario.py, since it's one place there, but many places here
| yield self.parse_scenario(child.scenario, feature, rule) | ||
| for child in rule_data["children"]: | ||
| if "scenario" in child: | ||
| yield self.parse_scenario(child["scenario"], feature, rule) # type: ignore[typeddict-item] |
There was a problem hiding this comment.
we should try avoiding # type: ignore. What's the issue here? Maybe we need to cast child to a specific type?
There was a problem hiding this comment.
shouldn't we keep testing the error messages?
youtux
left a comment
There was a problem hiding this comment.
maybe we should change gherkin-official to return classes instead of dicts now. WDYT?
Good point - ideally, I guess it should return the gherkin messages format (which will be dataclasses) so should wait to do this until that is resolved. I'll mark this as draft until then but you have rightly pointed out workarounds that should probably also be backported to gherkin-official. |
Remove the custom definition of the gherkin document as dataclasses in pytest-bdd.
Bump the minimum supported version of gherkin-official to v30 to support this and remove the warnings in python 3.13+