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

GGShield test suite fails with Python 3.12 #832

Open
agateau-gg opened this issue Jan 10, 2024 · 0 comments
Open

GGShield test suite fails with Python 3.12 #832

agateau-gg opened this issue Jan 10, 2024 · 0 comments
Labels
status:confirmed This issue has been reviewed and confirmed type:techdebt Fix non-optimal code

Comments

@agateau-gg
Copy link
Collaborator

agateau-gg commented Jan 10, 2024

GGShield test suite currently does not pass with Python 3.12. It fails with that error message:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/_pytest/config/__init__.py", line 190, in console_main
    code = main()
           ^^^^^^
[...]
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/snapshottest/__init__.py", line 3, in <module>
    from .module import assert_match_snapshot
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 168, in exec_module
    exec(co, module.__dict__)
  File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/snapshottest/module.py", line 4, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
[...]
Error: Process completed with exit code 1.

This is because the snapshottest package uses the deprecated-and-now-gone imp module. There is a PR to fix it here but it is not moving. It looks like snapshottest is unmaintained. We need to either use the code from the PR (ideally from our own fork) or replace snapshottest with a maintained Python package (https://github.com/joseph-roitman/pytest-snapshot could be a good candidate).

@agateau-gg agateau-gg added status:confirmed This issue has been reviewed and confirmed type:techdebt Fix non-optimal code labels Jan 10, 2024
@agateau-gg agateau-gg changed the title GGShield test suite does not pass with Python 3.12 GGShield test suite fails with Python 3.12 Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed This issue has been reviewed and confirmed type:techdebt Fix non-optimal code
Projects
None yet
Development

No branches or pull requests

1 participant