Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gherkin-official version bound raises DeprecationWarning on Python 3.13 #752

Closed
The-Compiler opened this issue Dec 6, 2024 · 2 comments · Fixed by #753
Closed

gherkin-official version bound raises DeprecationWarning on Python 3.13 #752

The-Compiler opened this issue Dec 6, 2024 · 2 comments · Fixed by #753

Comments

@The-Compiler
Copy link
Member

The-Compiler commented Dec 6, 2024

Describe the bug

When using a @tag with Python 3.13 and warnings enabled:

$ pytest -Wall --no-header test_py313.py
============================= test session starts ==============================
collected 1 item                                                               

test_py313.py s                                                          [100%]

=============================== warnings summary ===============================
.tox/py313-pyqt67/lib/python3.13/site-packages/gherkin/gherkin_line.py:79
  /home/florian/proj/qutebrowser/git/.tox/py313-pyqt67/lib/python3.13/site-packages/gherkin/gherkin_line.py:79: DeprecationWarning: 'maxsplit' is passed as positional argument
    uncommented_line = re.split(r"\s#", self._trimmed_line_text.strip(), 2)[0]

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 1 skipped, 1 warning in 0.07s =========================

To Reproduce

py313.feature:

Feature: nothing
    @skip
    Scenario: nothing

test_py313.py:

from pytest_bdd import scenarios
scenarios("py313.feature")

Expected behavior
No warning, as pytest-bdd should not have an upper gherkin-official bound, or at least have it on a more modern version.

Additional context
This was already fixed here:

And that was released as part of v30.0.0. However, pytest-bdd still pins an old version without full Python 3.13 compatibility:

gherkin-official = "^29.0.0"

Version

  • pytest version: 8.3.4
  • pytest-bdd version: 8.1.0
  • OS: Archlinux
@youtux
Copy link
Contributor

youtux commented Dec 8, 2024

Fixing this in #753, thank you for reporting it!

@The-Compiler
Copy link
Member Author

Thanks for the quick fix! FWIW, here is an appropriate workaround for pytest's filterwarnings:

ignore:'maxsplit' is passed as positional argument:DeprecationWarning:gherkin.gherkin_line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants