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

Running test suite with pytest hangs #1119

Open
Apteryks opened this issue Dec 23, 2024 · 2 comments
Open

Running test suite with pytest hangs #1119

Apteryks opened this issue Dec 23, 2024 · 2 comments

Comments

@Apteryks
Copy link
Contributor

Hi,

I'm attempting to update this package to 5.0.2 on GNU Guix, and I'm seeing the test suite hangs up always at this point:

guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_lint_file.py::TestLintFile::test_path_outside_project PASSED [ 21%]
guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_lint_file.py::TestLintFile::test_file_not_exists PASSED [ 21%]
guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_lint_file.py::TestLintFile::test_ignored_file PASSED [ 21%]
guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_lint_file.py::TestLintFile::test_file_covered_by_toml PASSED [ 21%]
guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_main.py::TestMain::test_help_is_default PASSED [ 22%]
guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/tests/test_cli_main.py::TestMain::test_version PASSED [ 22%]
[pytest uses 100% cpu, but no progress reported anymore]

The dependencies I'm using are:

Would you have an idea of what may be wrong?

Thanks.

@Apteryks
Copy link
Contributor Author

It seems I can't find a good way to run the test suite with pytest (or even with poetry run pytest) when the reuse module has already been installed and placed on sys.path. I get failures such as:

[...]
_____________________ ERROR collecting src/reuse/types.py ______________________
import file mismatch:
imported module 'reuse.types' has this __file__ attribute:
  /gnu/store/afpwbf3ha1fzbwhznijlkicdibwkv2j5-reuse-5.0.2/lib/python3.10/site-packages/reuse/types.py
which is not the same as the test file we want to collect:
  /tmp/guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/src/reuse/types.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
______________________ ERROR collecting src/reuse/vcs.py _______________________
import file mismatch:
imported module 'reuse.vcs' has this __file__ attribute:
  /gnu/store/afpwbf3ha1fzbwhznijlkicdibwkv2j5-reuse-5.0.2/lib/python3.10/site-packages/reuse/vcs.py
which is not the same as the test file we want to collect:
  /tmp/guix-build-reuse-5.0.2.drv-0/reuse-5.0.2/src/reuse/vcs.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
=========================== short test summary info ============================
ERROR src/reuse/_annotate.py
ERROR src/reuse/_licenses.py
ERROR src/reuse/_util.py
ERROR src/reuse/cli/annotate.py
ERROR src/reuse/cli/common.py
ERROR src/reuse/cli/convert_dep5.py
ERROR src/reuse/cli/download.py
ERROR src/reuse/cli/lint.py
ERROR src/reuse/cli/lint_file.py
ERROR src/reuse/cli/main.py
ERROR src/reuse/cli/spdx.py
ERROR src/reuse/cli/supported_licenses.py
ERROR src/reuse/comment.py
ERROR src/reuse/convert_dep5.py
ERROR src/reuse/copyright.py
ERROR src/reuse/covered_files.py
ERROR src/reuse/download.py
ERROR src/reuse/exceptions.py
ERROR src/reuse/extract.py
ERROR src/reuse/global_licensing.py
ERROR src/reuse/header.py
ERROR src/reuse/i18n.py
ERROR src/reuse/lint.py
ERROR src/reuse/project.py
ERROR src/reuse/report.py
ERROR src/reuse/types.py
ERROR src/reuse/vcs.py
!!!!!!!!!!!!!!!!!!! Interrupted: 27 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 27 errors in 0.35s ==============================
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "poetry" arguments: ("run" "pytest") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `check' failed after 0.9 seconds

@Apteryks
Copy link
Contributor Author

It's the test_simple that hangs; skipping it with -k 'not test_simple' allows the test suite to complete.

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

No branches or pull requests

1 participant