square / pylink

Python Library for device debugging/programming via J-Link
https://pylink.readthedocs.io/en/latest/
Other
334 stars 125 forks source link

1.2.0: Some tests are incompatible with Python 3.12 #197

Open dvzrv opened 3 months ago

dvzrv commented 3 months ago

Hi! :wave:

I package this project for Arch Linux. We are currently rebuilding against Python 3.12.

I noticed the following tests are now failing:

=========================== short test summary info ============================
FAILED tests/unit/test_jlink.py::TestJLink::test_cp15_register_write_success
FAILED tests/unit/test_jlink.py::TestJLink::test_jlink_restarted - AttributeE...
FAILED tests/unit/test_jlink.py::TestJLink::test_set_log_file_success - Attri...
FAILED tests/unit/test_library.py::TestLibrary::test_linux_dl_oserror - Attri...
FAILED tests/unit/test_library.py::TestLibrary::test_linux_dl_unavailable - A...
FAILED tests/unit/test_library.py::TestLibrary::test_linux_glibc_unavailable
======================== 6 failed, 436 passed in 1.13s =========================

python-pylink-square-1.2.0-2-x86_64-build.log python-pylink-square-1.2.0-2-x86_64-check.log

FTR: I am also applying https://github.com/square/pylink/pull/150 as we have removed mock from the repositories.

dvzrv commented 3 months ago

The test_library.py tests I can fix by replacing occurrences of assertEquals with assertEqual.

The other test failures seem harder to fix, maybe you have an idea?

I will ignore them for now

hkpeprah commented 2 months ago

Looks like Python 3 changed these two things:

I think changing both should be fine; it looks like we use assert_called_once_with() in other places: https://github.com/square/pylink/blob/master/tests/unit/test_library.py#L437