2
私はhow to contribute to Flaskチュートリアルに続きます。フラスコのテストスイートを実行しようとするとエラーが発生する
私はpytest tests/*.py
を実行すると、テストは合格したが、私は単にpytest
(上記参照に尋ねたとして)実行したとき、私はこのエラーメッセージが出ます:
pytest
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: /home/begueradj/flask, inifile: setup.cfg
collected 377 items/3 errors
==================================== ERRORS ====================================
____________ ERROR collecting examples/flaskr/tests/test_flaskr.py _____________
ImportError while importing test module '/home/begueradj/flask/examples/flaskr/tests/test_flaskr.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
examples/flaskr/tests/test_flaskr.py:15: in <module>
from flaskr import flaskr
E ImportError: No module named 'flaskr'
__________ ERROR collecting examples/minitwit/tests/test_minitwit.py ___________
ImportError while importing test module '/home/begueradj/flask/examples/minitwit/tests/test_minitwit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
examples/minitwit/tests/test_minitwit.py:14: in <module>
from minitwit import minitwit
E ImportError: No module named 'minitwit'
_____ ERROR collecting examples/patterns/largerapp/tests/test_largerapp.py _____
ImportError while importing test module '/home/begueradj/flask/examples/patterns/largerapp/tests/test_largerapp.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
examples/patterns/largerapp/tests/test_largerapp.py:1: in <module>
from yourapplication import app
E ImportError: No module named 'yourapplication'
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 3 error in 2.78 seconds ============================
を私の環境は次のとおりです。
- Ubuntu 16.04 LTS
- Python 3.5.2
- pytestバージョン3.0.7
なぜこのようなことが起こりましたか?