Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests can't be imported on 32-bit architectures: E AttributeError: module 'experimental' has no attribute 'igzip' #188

Open
mgorny opened this issue Nov 2, 2024 · 0 comments

Comments

@mgorny
Copy link

mgorny commented Nov 2, 2024

When trying to run the test suite on 32-bit architectures (ARM, i686), I'm immediately getting the following failures:

========================================================= test session starts =========================================================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/mgorny/cramjam
configfile: pyproject.toml
plugins: hypothesis-6.116.0
collected 1122 items / 2 errors                                                                                                       

=============================================================== ERRORS ================================================================
_____________________________________________ ERROR collecting tests/test_integration.py ______________________________________________
tests/test_integration.py:15: in <module>
    from .test_variants import same_same
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:184: in exec_module
    exec(co, module.__dict__)
tests/test_variants.py:25: in <module>
    mod = getattr(cramjam.experimental, experimental_feat)
E   AttributeError: module 'experimental' has no attribute 'igzip'
_______________________________________________ ERROR collecting tests/test_variants.py _______________________________________________
tests/test_variants.py:25: in <module>
    mod = getattr(cramjam.experimental, experimental_feat)
E   AttributeError: module 'experimental' has no attribute 'igzip'
======================================================= short test summary info =======================================================
ERROR tests/test_integration.py - AttributeError: module 'experimental' has no attribute 'igzip'
ERROR tests/test_variants.py - AttributeError: module 'experimental' has no attribute 'igzip'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 2 errors in 1.17s ==========================================================

Looking at:

#[cfg(all(
any(feature = "ideflate", feature = "ideflate-static", feature = "ideflate-shared"),
target_pointer_width = "64"
))]
#[pymodule_export]
use crate::ideflate::ideflate;
#[cfg(all(
any(feature = "igzip", feature = "igzip-static", feature = "igzip-shared"),
target_pointer_width = "64"
))]
#[pymodule_export]
use crate::igzip::igzip;
#[cfg(all(
any(feature = "izlib", feature = "izlib-static", feature = "izlib-shared"),
target_pointer_width = "64"
))]
#[pymodule_export]
use crate::izlib::izlib;

The i* variants are never used on 32-bit architectures but the test suite seems to expect them unconditionally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant