$ pwd ~/Projects/sample-flask # 一応確認 $ tree . ├── app.py └── tests/ └── test_test.py # -s オプションで、test*.pyを走査するディレクトリを指定できる $ python -m unittest discover -s tests . ---------------------------------------------------------------------- Ran 1 test in 0.049s OK
Python3 プロジェクト内のルートからtestsフォルダ内のtest*.pyをまとめて実行する

26.4. unittest — ユニットテストフレームワーク — Python 3.5.2 ドキュメントを参考に、Flaskでテストを実行してみた。
コメント