venusian icon indicating copy to clipboard operation
venusian copied to clipboard

Test failure in FrameInfoTest::testCallInfo on Python 3.13

Open musicinmybrain opened this issue 9 months ago • 0 comments

What I did:

  1. Check out current main, 966cce897c0a25485918f945eb83968d04933b2d
  2. Run tox -e py313

What I expect to happen:

All tests pass, as they do for tox -e py312.

What actually happened:

============================================================================================ test session starts ============================================================================================
platform linux -- Python 3.13.0b1, pytest-8.2.0, pluggy-1.5.0
cachedir: .tox/py313/.pytest_cache
rootdir: /home/ben/src/forks/venusian
configfile: setup.cfg
testpaths: tests
plugins: cov-5.0.0
collected 47 items                                                                                                                                                                                          

tests/test_advice.py F..                                                                                                                                                                              [  6%]
tests/test_venusian.py ............................................                                                                                                                                   [100%]

================================================================================================= FAILURES ==================================================================================================
________________________________________________________________________________________ FrameInfoTest.testCallInfo _________________________________________________________________________________________

self = <tests.test_advice.FrameInfoTest testMethod=testCallInfo>

    def testCallInfo(self):
        (kind, module, f_locals, f_globals, codeinfo) = advice.getFrameInfo(
            sys._getframe()
        )
        self.assertEqual(kind, "function call")
>       self.assertTrue(f_locals is locals())  # ???
E       AssertionError: False is not true

tests/test_advice.py:96: AssertionError

----------- coverage: platform linux, python 3.13.0-beta-1 -----------
Name                       Stmts   Miss   Cover   Missing
---------------------------------------------------------
src/venusian/__init__.py     178      0 100.00%
src/venusian/advice.py        24      0 100.00%
src/venusian/compat.py         7      2  71.43%   5-6
---------------------------------------------------------
TOTAL                        209      2  99.04%

========================================================================================== short test summary info ==========================================================================================
FAILED tests/test_advice.py::FrameInfoTest::testCallInfo - AssertionError: False is not true
======================================================================================= 1 failed, 46 passed in 0.21s ========================================================================================

This is related to PEP 667. The frame.f_locals is now a write-through proxy object of type FrameLocalsProxy.

The same issue exists due to the same assertion in zope.interface as https://github.com/zopefoundation/zope.interface/issues/292 and is being worked on in https://github.com/zopefoundation/zope.interface/pull/294.

musicinmybrain avatar May 15 '24 12:05 musicinmybrain