Skip to content

[Python 3.13.0b2] test_pdb_used_outside_test and test_pdb_used_in_generate_tests are failing with Python 3.13 #12497

@hrnciar

Description

@hrnciar

Hello, test_pdb_used_outside_test and test_pdb_used_in_generate_tests are failing with Python 3.13 beta 2 on Fedora Rawhide. The same error was observed also with pytest 7.4.3.

+ /builddir/build/BUILD/pytest-8.2.2-build/BUILDROOT/usr/bin/pytest testing --timeout=30 -n auto -rs
============================= test session starts ==============================
platform linux -- Python 3.13.0b2, pytest-8.2.2, pluggy-1.5.0
rootdir: /builddir/build/BUILD/pytest-8.2.2-build/pytest-8.2.2
configfile: pyproject.toml
plugins: timeout-2.3.1, xdist-3.6.1, hypothesis-6.98.8
timeout: 30.0s
timeout method: signal
timeout func_only: False
created: 2/2 workers
2 workers [3663 items]

........................................................................ [  1%]
......................................................ss................ [  3%]
............s...................................................x....... [  5%]
........................................................................ [  7%]
....................................Xs.................................. [  9%]
...sssssss............................x................................. [ 11%]
........................................................................ [ 13%]
........................................................................ [ 15%]
........................................................................ [ 17%]
........................................................................ [ 19%]
........................................................................ [ 21%]
........................................................................ [ 23%]
.............s.......................................................... [ 25%]
........................................................................ [ 27%]
...........................................s............................ [ 29%]
........................................................................ [ 31%]
..........................s............................................. [ 33%]
........................................................................ [ 35%]
........................................................................ [ 37%]
........................................................................ [ 39%]
........................................................................ [ 41%]
.x.............................................s........................ [ 43%]
.........sssss.ssss..................................................... [ 45%]
........................................................................ [ 47%]
........................................................................ [ 49%]
........................................................................ [ 51%]
......................................................................... [ 53%]
.x........................................................x............. [ 55%]
......................................................................x. [ 57%]
........................................................................ [ 58%]
..........................s............................................s [ 60%]
................................................................x....... [ 62%]
........................................................................ [ 64%]
.................................s.x.................................... [ 66%]
........................................................................ [ 68%]
........................................................................ [ 70%]
........................................................................ [ 72%]
.................................................x...................... [ 74%]
........................................................................ [ 76%]
.............................................................s.......... [ 78%]
...............................................s.......................x [ 80%]
........................x............................................... [ 82%]
........................................................................ [ 84%]
........................................................................ [ 86%]
........................................................................ [ 88%]
........................................................................ [ 90%]
......................................................................... [ 92%]
............................s........................................... [ 94%]
..sss...........................x......................................s [ 96%]
......X....XX..s...................................x.................... [ 98%]
.............................................xX....FF........            [100%]
=================================== FAILURES ===================================
______________________ TestPDB.test_pdb_used_outside_test ______________________
[gw1] linux -- Python 3.13.0 /usr/bin/python3

self = <test_debugging.TestPDB object at 0x7f9fbabf6d50>
pytester = <Pytester PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_outside_test0')>

    def test_pdb_used_outside_test(self, pytester: Pytester) -> None:
        p1 = pytester.makepyfile(
            """
            import pytest
            pytest.set_trace()
            x = 5
        """
        )
        child = pytester.spawn(f"{sys.executable} {p1}")
>       child.expect("x = 5")

/builddir/build/BUILD/pytest-8.2.2-build/pytest-8.2.2/testing/test_debugging.py:771: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/pexpect/spawnbase.py:354: in expect
    return self.expect_list(compiled_pattern_list,
/usr/lib/python3.13/site-packages/pexpect/spawnbase.py:383: in expect_list
    return exp.expect_loop(timeout)
/usr/lib/python3.13/site-packages/pexpect/expect.py:181: in expect_loop
    return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pexpect.expect.Expecter object at 0x7f9fa1526510>
err = TIMEOUT('Timeout exceeded.')

    def timeout(self, err=None):
        spawn = self.spawn
    
        spawn.before = spawn._before.getvalue()
        spawn.after = TIMEOUT
        index = self.searcher.timeout_index
        if index >= 0:
            spawn.match = TIMEOUT
            spawn.match_index = index
            return index
        else:
            spawn.match = None
            spawn.match_index = None
            msg = str(spawn)
            msg += '\nsearcher: %s' % self.searcher
            if err is not None:
                msg = str(err) + '\n' + msg
    
            exc = TIMEOUT(msg)
            exc.__cause__ = None    # in Python 3.x we can use "raise exc from None"
>           raise exc
E           pexpect.exceptions.TIMEOUT: Timeout exceeded.
E           <pexpect.pty_spawn.spawn object at 0x7f9fa1526900>
E           command: /usr/bin/python3
E           args: ['/usr/bin/python3', '/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_outside_test0/test_pdb_used_outside_test.py']
E           buffer (last 100 chars): b'est_pdb_used_outside_test0/test_pdb_used_outside_test.py(2)<module>()\r\n-> pytest.set_trace()\r\n(Pdb) '
E           before (last 100 chars): b'est_pdb_used_outside_test0/test_pdb_used_outside_test.py(2)<module>()\r\n-> pytest.set_trace()\r\n(Pdb) '
E           after: <class 'pexpect.exceptions.TIMEOUT'>
E           match: None
E           match_index: None
E           exitstatus: None
E           flag_eof: False
E           pid: 1483
E           child_fd: 18
E           closed: False
E           timeout: 10.0
E           delimiter: <class 'pexpect.exceptions.EOF'>
E           logfile: <_io.BufferedWriter name='/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_outside_test0/spawn.out'>
E           logfile_read: None
E           logfile_send: None
E           maxread: 2000
E           ignorecase: False
E           searchwindowsize: None
E           delaybeforesend: 0.05
E           delayafterclose: 0.1
E           delayafterterminate: 0.1
E           searcher: searcher_re:
E               0: re.compile(b'x = 5')

/usr/lib/python3.13/site-packages/pexpect/expect.py:144: TIMEOUT
___________________ TestPDB.test_pdb_used_in_generate_tests ____________________
[gw1] linux -- Python 3.13.0 /usr/bin/python3

self = <test_debugging.TestPDB object at 0x7f9fbabf6df0>
pytester = <Pytester PosixPath('/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_in_generate_tests0')>

    def test_pdb_used_in_generate_tests(self, pytester: Pytester) -> None:
        p1 = pytester.makepyfile(
            """
            import pytest
            def pytest_generate_tests(metafunc):
                pytest.set_trace()
                x = 5
            def test_foo(a):
                pass
        """
        )
        child = pytester.spawn_pytest(str(p1))
>       child.expect("x = 5")

/builddir/build/BUILD/pytest-8.2.2-build/pytest-8.2.2/testing/test_debugging.py:788: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.13/site-packages/pexpect/spawnbase.py:354: in expect
    return self.expect_list(compiled_pattern_list,
/usr/lib/python3.13/site-packages/pexpect/spawnbase.py:383: in expect_list
    return exp.expect_loop(timeout)
/usr/lib/python3.13/site-packages/pexpect/expect.py:181: in expect_loop
    return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pexpect.expect.Expecter object at 0x7f9fa135d010>
err = TIMEOUT('Timeout exceeded.')

    def timeout(self, err=None):
        spawn = self.spawn
    
        spawn.before = spawn._before.getvalue()
        spawn.after = TIMEOUT
        index = self.searcher.timeout_index
        if index >= 0:
            spawn.match = TIMEOUT
            spawn.match_index = index
            return index
        else:
            spawn.match = None
            spawn.match_index = None
            msg = str(spawn)
            msg += '\nsearcher: %s' % self.searcher
            if err is not None:
                msg = str(err) + '\n' + msg
    
            exc = TIMEOUT(msg)
            exc.__cause__ = None    # in Python 3.x we can use "raise exc from None"
>           raise exc
E           pexpect.exceptions.TIMEOUT: Timeout exceeded.
E           <pexpect.pty_spawn.spawn object at 0x7f9fa135ecf0>
E           command: /usr/bin/python3
E           args: ['/usr/bin/python3', '-mpytest', '--basetemp=/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_in_generate_tests0/temp-pexpect', '/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_in_generate_tests0/test_pdb_used_in_generate_tests.py']
E           buffer (last 100 chars): b'e_tests0/test_pdb_used_in_generate_tests.py(3)pytest_generate_tests()\r\n-> pytest.set_trace()\r\n(Pdb) '
E           before (last 100 chars): b'e_tests0/test_pdb_used_in_generate_tests.py(3)pytest_generate_tests()\r\n-> pytest.set_trace()\r\n(Pdb) '
E           after: <class 'pexpect.exceptions.TIMEOUT'>
E           match: None
E           match_index: None
E           exitstatus: None
E           flag_eof: False
E           pid: 1484
E           child_fd: 19
E           closed: False
E           timeout: 10.0
E           delimiter: <class 'pexpect.exceptions.EOF'>
E           logfile: <_io.BufferedWriter name='/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_pdb_used_in_generate_tests0/spawn.out'>
E           logfile_read: None
E           logfile_send: None
E           maxread: 2000
E           ignorecase: False
E           searchwindowsize: None
E           delaybeforesend: 0.05
E           delayafterclose: 0.1
E           delayafterterminate: 0.1
E           searcher: searcher_re:
E               0: re.compile(b'x = 5')

/usr/lib/python3.13/site-packages/pexpect/expect.py:144: TIMEOUT
=========================== short test summary info ============================
SKIPPED [1] testing/_py/test_local.py:464: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:469: sys.version_info < (3,6)
SKIPPED [1] testing/_py/test_local.py:669: case-insensitive only on windows
SKIPPED [1] testing/_py/test_local.py:890: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1242: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1248: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1260: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1266: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1271: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1279: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/_py/test_local.py:1286: condition: not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')
SKIPPED [1] testing/test_tmpdir.py:359: win only
SKIPPED [1] testing/test_capture.py:1435: only on windows
SKIPPED [1] testing/test_findpaths.py:142: condition: sys.platform != 'win32'
SKIPPED [1] testing/acceptance_test.py:1424: Test is not isolated
SKIPPED [9] testing/code/test_excinfo.py:1678: could not import 'exceptiongroup': No module named 'exceptiongroup'
SKIPPED [1] ../BUILDROOT/usr/lib/python3.13/site-packages/_pytest/pathlib.py:473: symlinks not supported: [Errno 17] File exists: '/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_collect_symlink_dir0/symlink_dir' -> '/tmp/pytest-of-mockbuild/pytest-0/popen-gw1/test_collect_symlink_dir0/dir'
SKIPPED [1] testing/test_collection.py:1784: Windows only
SKIPPED [1] testing/test_conftest.py:397: only relevant for case-insensitive file systems
SKIPPED [1] testing/test_pathlib.py:547: Windows only
SKIPPED [1] testing/test_pluginmanager.py:108: requires a case-insensitive file system
SKIPPED [1] testing/test_unittest.py:1326: could not import 'asynctest': No module named 'asynctest'
SKIPPED [3] testing/test_warnings.py:518: not relevant until pytest 9.0
SKIPPED [1] testing/test_compat.py:97: coroutine removed
SKIPPED [1] testing/test_faulthandler.py:72: sometimes crashes on CI (#7022)
= 2 failed, 3607 passed, 35 skipped, 14 xfailed, 5 xpassed in 115.37s (0:01:55) =

Metadata

Metadata

Assignees

Labels

type: selftestsa problem in the tests of pytest

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy