```ini # pytest.ini [pytest] # テストディレクトリ testpaths = tests # Pythonパス pythonpath = src # マーカー定義 markers = slow: 時間がかかるテスト integration: 統合テスト unit: 単体テスト # 実行オプション addopts = -v --strict-markers ...
import pytest # 1. 基本パターン @pytest.mark.parametrize("input, expected", [ (1, 2), (2, 4), (3, 6), ]) def test_double(input, expected): assert input * 2 ...