これは、TDDBCのPythonista向け Pytest プロジェクトです
- Python 3.12.4
- pytest 8.2.2
※Python2は2020年1月にサポート終了(EOL)していますので、Python3をご利用ください。
以下のように実行して、環境を構築してください。
$ git clone https://github.com/yattom/python_pytest.git
$ cd python_pytest
$ pip3 install -r requirements.txt
テストを実行するには pytest コマンドを使います。
$ pytest
...
# Output sample
====================================== test session starts ======================================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /root/python_pytest
configfile: setup.cfg
plugins: cov-5.0.0, xdist-3.6.1
collected 3 items
tests/acme/test_snake.py::TestPython::test_be_out_of_question PASSED [ 33%]
tests/acme/test_snake.py::TestMontyPython::test_say_name[Monty Python] PASSED [ 66%]
tests/acme/test_snake.py::TestMontyPython::test_say_name[John Smith] PASSED [100%]
======================================= 3 passed in 0.02s =======================================
のように正常終了すればOKです
MIT ライセンスです (詳しくはプロジェクト直下の LICENSE をご覧ください)