Skip to content

Use relative import for utils in test_pythoncapi_compat#169

Open
different-name wants to merge 1 commit intopython:mainfrom
different-name:fix-test-imports
Open

Use relative import for utils in test_pythoncapi_compat#169
different-name wants to merge 1 commit intopython:mainfrom
different-name:fix-test-imports

Conversation

@different-name
Copy link

Fix for the following test error:

============================= test session starts ==============================
platform linux -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /build/srctools-2.6.2
configfile: pyproject.toml
plugins: regressions-2.9.1, datadir-1.8.0
collecting ... ^Mcollecting 1585 items / 1 error                                                ^Mcollected 3619 items / 1 error                                                 

==================================== ERRORS ====================================
____ ERROR collecting src/pythoncapi-compat/tests/test_pythoncapi_compat.py ____
ImportError while importing test module '/build/srctools-2.6.2/src/pythoncapi-compat/tests/test_pythoncapi_compat.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/nix/store/m1fw8l8y9ycxh5dzispbb7cwl6rra14l-python3-3.13.12/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/pythoncapi-compat/tests/test_pythoncapi_compat.py:24: in <module>
    from utils import run_command, command_stdout
E   ModuleNotFoundError: No module named 'utils'
=========================== short test summary info ============================
ERROR src/pythoncapi-compat/tests/test_pythoncapi_compat.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.82s ===============================

Not sure why this is only an issue now, however this seems to be the correct approach

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 this pull request may close these issues.

1 participant