Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

test_python_dash_m_faircode_runs_the_cli fails when the installed faircode script belongs to another Python

Closed Beginner friendly
#1,096 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1103 by @propcgamer20-png — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Read tests/test_cli.py, especially test_python_dash_m_faircode_runs_the_cli, and check how it locates and runs the faircode console script. Use sys.executable to identify the matching Scripts or bin directory, and skip with a clear message when no script is present. Run the named pytest test with a stray script on PATH, then run make test-fast; done means both checks pass and the matching console script is still verified when available.

Written by the indexing model from the issue text.

Description

bug good first issue

Where: tests/test_cli.py test_python_dash_m_faircode_runs_the_cli (the last four lines).

Current gap: after the python -m faircode checks, the test runs the first faircode found on PATH with --version and asserts exit code 0. On a machine where which faircode points at a console script installed for a different Python (for example a system Python without this checkout installed), that script exits 1 with ModuleNotFoundError: No module named 'faircode', and the test fails even though the repo is fine. CI passes only because its faircode is the editable install of the same interpreter.

Repro: on a machine with a stray faircode console script on PATH that cannot import the package (/Library/Frameworks/Python.framework/Versions/3.13/bin/faircode here): python3 -m pytest tests/test_cli.py::test_python_dash_m_faircode_runs_the_cli.

Suggested approach: locate the script that belongs to sys.executable (the Scripts/bin directory next to it), run that one, and skip the check with a clear message if there is none, instead of trusting PATH.

Done when: the test passes with a stray faircode script on PATH, still verifies the console script when one exists for the running interpreter, and make test-fast is green on a machine with several Pythons.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
3h 4m
Merged PRs (30d)
83

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.