【Pytest】pytestでカバレッジ率を出してみる

下記の記事で作ったpytest環境でカバレッジ率を出してみます。

コンテナに入る

docker compose exec app bash

pytest-covをインストール

pip install pytest-cov

実行

普通にpytestを実行するコマンドに–covオプションを付けるだけ。

pytest tests --cov

以上になります。
お読み頂き、ありがとうございました。