Summary
The test helper assert_no_toolchain_override defined in .github/actions/rust-build-release/tests/rust_build_release_test_helpers.py is imported by test modules (e.g. test_manifest_path.py) using a bare module import:
from rust_build_release_test_helpers import assert_no_toolchain_override
The tests directory currently has no __init__.py, so it is not a Python package. This bare import works only because pytest injects the directory into sys.path. Importing the test module directly outside pytest fails with:
ModuleNotFoundError: No module named 'rust_build_release_test_helpers'
Changing the import to a relative form (from .rust_build_release_test_helpers import ...) would also fail under the current layout because there is no package context.
Recommended fix
Either:
- Add an
__init__.py to .github/actions/rust-build-release/tests/ to make it a proper Python package and switch to relative imports (from .rust_build_release_test_helpers import ...), or
- Move the helper into a module that is importable consistently by all test runners (e.g. via
conftest.py or a properly installed package).
Context
Identified during review of PR #255 (#255) and verified against the current state of the branch; not addressed in that PR.
Reported by @leynos.
Summary
The test helper
assert_no_toolchain_overridedefined in.github/actions/rust-build-release/tests/rust_build_release_test_helpers.pyis imported by test modules (e.g.test_manifest_path.py) using a bare module import:The
testsdirectory currently has no__init__.py, so it is not a Python package. This bare import works only because pytest injects the directory intosys.path. Importing the test module directly outside pytest fails with:Changing the import to a relative form (
from .rust_build_release_test_helpers import ...) would also fail under the current layout because there is no package context.Recommended fix
Either:
__init__.pyto.github/actions/rust-build-release/tests/to make it a proper Python package and switch to relative imports (from .rust_build_release_test_helpers import ...), orconftest.pyor a properly installed package).Context
Identified during review of PR #255 (#255) and verified against the current state of the branch; not addressed in that PR.
Reported by @leynos.