You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like on higher versions tests/compat/py38.py should be skipped
==================================================================================== test session starts ====================================================================================platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0rootdir: /home/tkloczko/rpmbuild/BUILD/tempora-5.6.0configfile: pytest.inicollected 23 items / 1 error========================================================================================== ERRORS ===========================================================================================__________________________________________________________________________ ERROR collecting tests/test_schedule.py __________________________________________________________________________ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/tempora-5.6.0/tests/test_schedule.py'.Hint: make sure your test modules/packages have valid Python names.Traceback:tests/test_schedule.py:11: in <module> from .compat.py38 import zoneinfoE ImportError: cannot import name 'zoneinfo' from 'tests.compat.py38' (/home/tkloczko/rpmbuild/BUILD/tempora-5.6.0/tests/compat/py38.py)================================================================================== short test summary info ==================================================================================ERROR tests/test_schedule.py!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!===================================================================================== 1 error in 0.19s ======================================================================================
The text was updated successfully, but these errors were encountered:
Looks like in those places could be used something like
ifsys.version_info>= (3, 9):
importzoneinfoelse:
from .compat.py38importzoneinfo
The conditional code is already present in tests.compat.py38. It's set up that way so that tests.compat.py38.zoneinfo is always a valid name regardless of Python version.
Since you're on Python 3.10, I'd expect that first line of the branch to be executed and import zoneinfo to be executed, adding zoneinfo to the module namespace.
Note that these tests do run fine in CI, so the problem isn't with the code, but with some factor that's different in your environment.
Can you confirm that in your environment, python3.10 -c 'import zoneinfo' exits with code 0?
If the issue isn't the presence of the zoneinfo module, can you investigate what other differences might be causing the issue?
Looks like on higher versions tests/compat/py38.py should be skipped
The text was updated successfully, but these errors were encountered: