Skip to content

Commit

Permalink
Ensure unique basename for test file modules
Browse files Browse the repository at this point in the history
Pytest will get confused otherwise:

================================ ERRORS ================================
___________ ERROR collecting src/graylint/tests/test_main.py ___________
import file mismatch:
imported module 'test_main' has this __file__ attribute:
  /home/akaihola/prg/graylint/action/tests/test_main.py
which is not the same as the test file we want to collect:
  /home/akaihola/prg/graylint/src/graylint/tests/test_main.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for
      your test file modules
======================= short test summary info ========================
ERROR src/graylint/tests/test_main.py
!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!
  • Loading branch information
akaihola committed Apr 2, 2024
1 parent b874746 commit 9b9a304
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,10 @@ def test_creates_virtualenv(tmp_path, main_patch):

@pytest.mark.kwparametrize(
dict(run_main_env={}, expect=["graylint[color]"]),
dict(
run_main_env={"INPUT_VERSION": "1.5.0"}, expect=["graylint[color]==1.5.0"]
),
dict(run_main_env={"INPUT_VERSION": "1.5.0"}, expect=["graylint[color]==1.5.0"]),
dict(
run_main_env={"INPUT_VERSION": "@main"},
expect=[
"git+https://github.com/akaihola/graylint@main#egg=graylint[color]"
],
expect=["git+https://github.com/akaihola/graylint@main#egg=graylint[color]"],
),
dict(
run_main_env={"INPUT_LINT": "pylint"},
Expand Down

0 comments on commit 9b9a304

Please sign in to comment.