Pythonパッケージのテストとデータ#
Adding tests to your package provides a set of checks that ensure that its functioning how you expect it to.
In this section, you will learn about the importance of writing tests for your Python package, different types of tests that you should consider and how you can set up infrastructure to run your tests both locally and on GitHub.
Learn about the importance of writing tests for your Python package and how they help you and potential contributors.
単体テスト、統合テスト、エンドツーエンド テストの 3 つのテスト タイプについて理解します。それぞれをいつどのように使用するかを学びます。
コンピューター上のさまざまな Python バージョン間でテストを実行するための、pytest、nox、tox などのテスト ツールについて学びます。また、タスク ランナーとして Hatch with UV を使用して、Python バージョン間でテストを実行する例を調べてください。
Nox は、テストの実行に使用できる Python を利用したタスク ランナーです。 nox を使用してテストを実行する方法を学びます。
GitHub Actions との継続的統合を設定して、Python のバージョンとオペレーティング システム間でテストを実行します。
テスト中に実行されるパッケージ コードの量を測定します。ローカル レポートを生成し、オンラインでカバレッジを視覚化する方法を学びます。