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.

Pythonパッケージのテストを書く
✨テストの種類✨

Get to know the three test types: unit, integration, and end-to-end tests. Learn when and how to use each.

Pythonパッケージのテストタイプ
✨ローカルでテストを実行する✨

Learn about testing tools like pytest, nox, and tox to run tests across different Python versions on your computer. And explore examples of using Hatch with UV as a task runner to run tests across Python versions.

Run tests for your Python package
✨ Run tests locally (using nox) ✨

Nox is a python powered task runner that can be used to run tests. Learn how to use nox to run tests.

Run tests with Nox
✨オンラインでテストを実行する(CIを使用する)✨

Set up continuous integration with GitHub Actions to run tests across Python versions and operating systems.

継続的インテグレーションによるテストの実行
✨ Code coverage ✨

Measure how much of your package code runs during tests. Learn to generate local reports and visualize coverage online.

Pythonパッケージのテストスイートのコードカバレッジ