|
6 | 6 | import time |
7 | 7 | from pathlib import Path |
8 | 8 |
|
| 9 | +import pytest |
| 10 | + |
9 | 11 |
|
10 | 12 | ROOT = Path(__file__).resolve().parents[1] |
11 | 13 | RUNNER = Path(__file__).with_name("shutdown_runner.py") |
@@ -189,14 +191,12 @@ def test_shutdown_exception_on_cancel(): |
189 | 191 | def test_shutdown_ignore_cancel(): |
190 | 192 | _run_shutdown_case("ignore_cancel", signals=2) |
191 | 193 |
|
192 | | - |
193 | | -def test_examples_complete_without_sigint(): |
194 | | - for method in _available_start_methods(): |
195 | | - _run_example_case("complete", start_method=method) |
196 | | - _run_example_case("normalterm", start_method=method) |
197 | | - _run_example_case("normalterm_thread", start_method=method) |
| 194 | +@pytest.mark.parametrize("case", ["complete", "normalterm", "normalterm_thread"]) |
| 195 | +@pytest.mark.parametrize("start_method", _available_start_methods()) |
| 196 | +def test_examples_complete_without_sigint(case: str, start_method: str) -> None: |
| 197 | + _run_example_case(case, start_method=start_method) |
198 | 198 |
|
199 | 199 |
|
200 | | -def test_ezmsg_toy_requires_sigint(): |
201 | | - for method in _available_start_methods(): |
202 | | - _run_example_case("infinite", start_method=method, signals=1) |
| 200 | +@pytest.mark.parametrize("start_method", _available_start_methods()) |
| 201 | +def test_infinite_requires_sigint(start_method: str) -> None: |
| 202 | + _run_example_case("infinite", start_method=start_method, signals=1) |
0 commit comments