Bug 2246116 - python-pytest-bdd fails to build with Python 3.13: RecursionError: maximum recursion depth exceeded in comparison
Summary: python-pytest-bdd fails to build with Python 3.13: RecursionError: maximum re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pytest-bdd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ben Beasley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-25 13:19 UTC by Karolina Surma
Modified: 2024-05-15 15:47 UTC (History)
3 users (show)

Fixed In Version: python-pytest-bdd-6.1.1-15.fc40 python-pytest-bdd-7.1.2-2.fc41
Clone Of:
Environment:
Last Closed: 2023-10-27 20:46:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pytest-dev pytest-bdd issues 643 0 None open Python 3.13: test_generate_missing fails with unbound recursion 2023-10-27 20:19:55 UTC

Description Karolina Surma 2023-10-25 13:19:52 UTC
python-pytest-bdd fails to build with Python 3.13.0a1.

=================================== FAILURES ===================================
____________________________ test_generate_missing _____________________________
[gw1] linux -- Python 3.13.0 /usr/bin/python3

pytester = <Pytester PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_generate_missing0')>

    def test_generate_missing(pytester):
        """Test generate missing command."""
        pytester.makefile(
            ".feature",
            generation=textwrap.dedent(
                """\
                Feature: Missing code generation
    
                    Background:
                        Given I have a foobar
    
                    Scenario: Scenario tests which are already bound to the tests stay as is
                        Given I have a bar
    
    
                    Scenario: Code is generated for scenarios which are not bound to any tests
                        Given I have a bar
    
    
                    Scenario: Code is generated for scenario steps which are not yet defined(implemented)
                        Given I have a custom bar
                """
            ),
        )
    
        pytester.makepyfile(
            textwrap.dedent(
                """\
            import functools
    
            from pytest_bdd import scenario, given
    
            scenario = functools.partial(scenario, "generation.feature")
    
            @given("I have a bar")
            def _():
                return "bar"
    
            @scenario("Scenario tests which are already bound to the tests stay as is")
            def test_foo():
                pass
    
            @scenario("Code is generated for scenario steps which are not yet defined(implemented)")
            def test_missing_steps():
                pass
            """
            )
        )
    
        result = pytester.runpytest("--generate-missing", "--feature", "generation.feature")
        result.assert_outcomes(passed=0, failed=0, errors=0)
        assert not result.stderr.str()
>       assert result.ret == 0
E       assert <ExitCode.INTERNAL_ERROR: 3> == 0
E        +  where <ExitCode.INTERNAL_ERROR: 3> = <RunResult ret=3 len(stdout.lines)=19 len(stderr.lines)=0 duration=0.05s>.ret

pytester   = <Pytester PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_generate_missing0')>
result     = <RunResult ret=3 len(stdout.lines)=19 len(stderr.lines)=0 duration=0.05s>

/builddir/build/BUILD/pytest-bdd-6.1.1/_empty/tests/generation/test_generate_missing.py:69: AssertionError
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform linux -- Python 3.13.0a1, pytest-7.4.2, pluggy-1.3.0
rootdir: /tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_generate_missing0
plugins: bdd-6.1.1, xdist-3.3.1
collected 2 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.13/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/builddir/build/BUILDROOT/python-pytest-bdd-6.1.1-14.fc40.x86_64/usr/lib/python3.13/site-packages/pytest_bdd/generation.py", line 184, in _show_missing_code_main
INTERNALERROR>     if scenario in scenarios:
INTERNALERROR>        ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "<string>", line 4, in __eq__
INTERNALERROR>   File "<string>", line 4, in __eq__
INTERNALERROR>   File "<string>", line 4, in __eq__
INTERNALERROR>   [Previous line repeated 486 more times]
INTERNALERROR> RecursionError: maximum recursion depth exceeded in comparison

============================ no tests ran in 0.02s =============================
=========================== short test summary info ============================
FAILED tests/generation/test_generate_missing.py::test_generate_missing - ass...
======================== 1 failed, 118 passed in 4.35s =========================

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06561136-python-pytest-bdd/

For all our attempts to build python-pytest-bdd with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-pytest-bdd/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Beasley 2023-10-27 19:43:39 UTC
Version 7.0.0 (bug 2243132) does NOT fix this, but updating is a prerequisite to investigating.

Comment 2 Ben Beasley 2023-10-27 20:19:47 UTC
Reported upstream: https://github.com/pytest-dev/pytest-bdd/issues/643

Comment 3 Ben Beasley 2023-10-27 20:28:55 UTC
(In reply to Ben Beasley from comment #1)
> Version 7.0.0 (bug 2243132) does NOT fix this, but updating is a
> prerequisite to investigating.

I take that back: now that I have reported the problem upstream, I am going to go ahead and skip the test before updating to 7.0.0 (and keep the skip after updating).

Comment 4 Fedora Update System 2023-10-27 20:44:01 UTC
FEDORA-2023-e9cf26918d has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e9cf26918d

Comment 5 Fedora Update System 2023-10-27 20:46:10 UTC
FEDORA-2023-e9cf26918d has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2024-05-15 12:19:08 UTC
FEDORA-2024-dc228b1570 (python-pytest-bdd-7.1.2-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-dc228b1570

Comment 7 Fedora Update System 2024-05-15 15:47:15 UTC
FEDORA-2024-dc228b1570 (python-pytest-bdd-7.1.2-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.