python-libusb1 icon indicating copy to clipboard operation
python-libusb1 copied to clipboard

Test failure with python 3.13

Open xdbob opened this issue 1 year ago • 0 comments

Unit tests are failing with python 3.13 (found on fedora rawhide):

======================================================================
FAIL: testDefaultEnumScope (usb1.testUSB1.USBTransferTests.testDefaultEnumScope)
Enum instances must only affect the scope they are created in.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/xx/pkg/usb1/testUSB1.py", line 289, in testDefaultEnumScope
    self.assertEqual(local_dict.get(ENUM_NAME), ENUM_VALUE)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None != 42

----------------------------------------------------------------------
Ran 13 tests in 0.079s

My understanding of the situation is that the test is not compatible with the new PEP 667, specifically the following change:

For function scopes it will return an instantaneous snapshot of the underlying frame.f_locals.

eg: we do the variable assignment after we took a snapshot of the locals.

Downstream fedora bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2280555

xdbob avatar Aug 13 '24 15:08 xdbob