You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And when I run python manage.py test it fails with ERROR: file not found: test. Turns out pytest interprets the function name as a file name and it fails because the file does not exist.
Strangely, if I change the function slightly:
@manager.commanddeftest():
pytest.main('-v') # Run in verbose mode
It runs perfectly! I don't even have to install myapp in editable mode nor set the PYTHONPATH environment variable (which is weird since if I run py.test on project_dir it fails to import myapp). What's happening here?
I am using OS X 10.11, Python 3.4.3, and here's my pip freeze output:
Hi,
I have a Flask application with directory structure like this:
I am using Flask-Script plugin so I can do
python manage.py test
to run pytest. I have this in mymanage.py
file:And when I run
python manage.py test
it fails withERROR: file not found: test
. Turns out pytest interprets the function name as a file name and it fails because the file does not exist.Strangely, if I change the function slightly:
It runs perfectly! I don't even have to install myapp in editable mode nor set the
PYTHONPATH
environment variable (which is weird since if I runpy.test
onproject_dir
it fails to importmyapp
). What's happening here?I am using OS X 10.11, Python 3.4.3, and here's my
pip freeze
output:Any help will be appreciated. Thank you.
The text was updated successfully, but these errors were encountered: