flask-pytest-example
flask-pytest-example copied to clipboard
Pytest Fails
=========================================== test session starts ============================================
platform linux -- Python 3.8.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/danwand/work/bfh/flask-pytest-example
plugins: flask-1.2.0, requests-mock-1.8.0
collected 0 items / 1 error
================================================== ERRORS ==================================================
__________________________________ ERROR collecting tests/test_routes.py ___________________________________
ImportError while importing test module '/home/danwand/work/bfh/flask-pytest-example/tests/test_routes.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_routes.py:4: in <module>
from flask_pytest_example.handlers.routes import configure_routes
E ModuleNotFoundError: No module named 'flask_pytest_example'
========================================= short test summary info ==========================================
ERROR tests/test_routes.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 error in 0.08s =============================================
Had this same issue, it's likely because your repo name and the import names are off. I needed to change the repo (folder) name from flask-pytest-example to flask_pytest_example