tests/js_helpers.py is imported by bare name, so pytest --import-mode=importlib cannot collect the parity tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- build-system, testing
Research direction
Read pyproject.toml, tests/test_declared_dependencies.py, and the tests/test_js_parity_*.py imports. Reproduce the collection failure with python3 -m pytest tests/test_js_parity_profile.py -q --import-mode=importlib, then compare the two suggested import approaches. Done when the dependency whitelist is removed and the parity tests collect in both import modes in CI.
Written by the indexing model from the issue text.
Description
Where: tests/test_js_parity_*.py (from js_helpers import ..., added by the split in #938), pyproject.toml, tests/test_declared_dependencies.py.
Current gap: the parity tests import their shared helpers as the top-level module js_helpers, which only works because pytest's default prepend import mode puts tests/ on sys.path. Under --import-mode=importlib (which pytest recommends for new projects) collection fails, and the helper had to be whitelisted in NOT_A_PYPROJECT_DEPENDENCY so the dependency check would not call it a third-party package.
Repro:
$ python3 -m pytest tests/test_js_parity_profile.py -q --import-mode=importlib
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
Suggested approach: add pythonpath = ["tests"] under [tool.pytest.ini_options] (and keep the module name) or make tests a package and import tests.js_helpers; then drop the whitelist entry and run the suite in both import modes in CI.
- Dominant language
- HTML
- Stars
- 47
- Forks
- 45
- Avg merge
- 2h 54m
- Merged PRs (30d)
- 59
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yakew7/Fair-Code
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
All issues in yakew7/Fair-Code
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#416 ·
Maintainers usually reply within 1 day
-
--version on a main build shows no commit hashPossibly taken @switch87 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
storytold/photocraft#5247 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/grails-core#16635 ·
Maintainers usually reply within 1 day