Skip to content

Commit 5a8b6da

Browse files
committed
shutdown tests parameterized
1 parent a1bcf1f commit 5a8b6da

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

tests/test_clean_shutdown.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import time
77
from pathlib import Path
88

9+
import pytest
10+
911

1012
ROOT = Path(__file__).resolve().parents[1]
1113
RUNNER = Path(__file__).with_name("shutdown_runner.py")
@@ -189,14 +191,12 @@ def test_shutdown_exception_on_cancel():
189191
def test_shutdown_ignore_cancel():
190192
_run_shutdown_case("ignore_cancel", signals=2)
191193

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)
198198

199199

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

Comments
 (0)