Skip to content

Local test failure: ModuleNotFoundError: No module named 'helper' #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
blueyed opened this issue Mar 8, 2019 · 3 comments
Closed

Local test failure: ModuleNotFoundError: No module named 'helper' #270

blueyed opened this issue Mar 8, 2019 · 3 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Mar 8, 2019

I am seeing the following test failure locally, also when using tox, even from
a fresh git clone:

platform linux -- Python 3.7.2, pytest-4.3.0, py-1.8.0, pluggy-0.9.0
rootdir: …/Vcs/pytest-cov, inifile: setup.cfg
plugins: forked-1.0.2, cov-2.6.1
collected 113 items

tests/test_pytest_cov.py F

=========================================================================================== FAILURES ===========================================================================================
____________________________________________________________________________________ test_central[branch2x] ____________________________________________________________________________________
…/Vcs/pytest-cov/tests/test_pytest_cov.py:187: in test_central
    '*10 passed*'
E   Failed: nomatch: '*- coverage: platform *, python * -*'
E       and: '============================= test session starts =============================='
E       and: 'platform linux -- Python 3.7.2, pytest-4.3.0, py-1.8.0, pluggy-0.9.0 -- …/Vcs/pytest-cov/.venv/bin/python'
E       and: 'cachedir: .pytest_cache'
E       and: 'rootdir: /tmp/pytest-of-user/pytest-647/test_central0, inifile:'
E       and: 'plugins: forked-1.0.2, cov-2.6.1'
E       and: 'collecting ... collected 0 items / 1 errors'
E       and: ''
E       and: '==================================== ERRORS ===================================='
E       and: '_______________________ ERROR collecting test_central.py _______________________'
E       and: "ImportError while importing test module '/tmp/pytest-of-user/pytest-647/test_central0/test_central.py'."
E       and: 'Hint: make sure your test modules/packages have valid Python names.'
E       and: 'Traceback:'
E       and: 'test_central.py:1: in <module>'
E       and: '    import sys, helper'
E       and: "E   ModuleNotFoundError: No module named 'helper'"
E       and: ''
E   fnmatch: '*- coverage: platform *, python * -*'
E      with: '----------- coverage: platform linux, python 3.7.2-final-0 -----------'
E   nomatch: 'test_central* 9 * 85% *'
E       and: 'Name              Stmts   Miss Branch BrPart  Cover   Missing'
E       and: '-------------------------------------------------------------'
E       and: 'test_central.py       9      8      4      0     8%   3-11'
E       and: ''
E       and: '!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!'
E       and: '=========================== 1 error in 0.05 seconds ============================'
E   remains unmatched: 'test_central* 9 * 85% *'
------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------
running: …/Vcs/pytest-cov/.venv/bin/python -mpytest --basetemp=/tmp/pytest-of-user/pytest-647/test_central0/runpytest-0 -v --cov=/tmp/pytest-of-user/pytest-647/test_central0 --cov-report=term-missing /tmp/pytest-of-user/pytest-647/test_central0/test_central.py --cov-branch --basetemp=/tmp/pytest-of-user/pytest-647/basetemp
     in: /tmp/pytest-of-user/pytest-647/test_central0
============================= test session starts ==============================
platform linux -- Python 3.7.2, pytest-4.3.0, py-1.8.0, pluggy-0.9.0 -- …/Vcs/pytest-cov/.venv/bin/python
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-user/pytest-647/test_central0, inifile:
plugins: forked-1.0.2, cov-2.6.1
collecting ... collected 0 items / 1 errors

==================================== ERRORS ====================================
_______________________ ERROR collecting test_central.py _______________________
ImportError while importing test module '/tmp/pytest-of-user/pytest-647/test_central0/test_central.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_central.py:1: in <module>
    import sys, helper
E   ModuleNotFoundError: No module named 'helper'

----------- coverage: platform linux, python 3.7.2-final-0 -----------
Name              Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------
test_central.py       9      8      4      0     8%   3-11

!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.05 seconds ============================
=================================================================================== short test summary info ====================================================================================
FAILED tests/test_pytest_cov.py::test_central[branch2x]
@blueyed
Copy link
Contributor Author

blueyed commented Mar 8, 2019

That's due to the missing PYTHONPATH={toxinidir}/tests..

@ionelmc
Copy link
Member

ionelmc commented Mar 9, 2019

@blueyed I'm not sure if @271 actually fixes this, maybe you accidentally removed the PYTHONPATH extension from tox.ini?

@blueyed
Copy link
Contributor Author

blueyed commented Mar 9, 2019

@ionelmc
I was using it without tox apparently.

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

No branches or pull requests

2 participants