From 4a8ced9d62b815d98936a2e27b2f4b8c7da33c07 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Wed, 11 May 2022 08:14:28 -0500 Subject: [PATCH] separate parametrized vars for clarity --- testing/test_terminal.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 2f1facbe1..1add0127e 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1140,15 +1140,17 @@ class TestTerminalFunctional: @pytest.mark.parametrize( - "use_CI", + ("use_ci", "expected_message"), ( (True, f"- AssertionError: {'this_failed'*100}"), (False, "- AssertionError: this_failedt..."), ), ids=("on CI", "not on CI"), ) -def test_fail_extra_reporting(pytester: Pytester, monkeypatch, use_CI) -> None: - if use_CI[0]: +def test_fail_extra_reporting( + pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str +) -> None: + if use_ci: monkeypatch.setenv("CI", "true") else: monkeypatch.delenv("CI", raising=False) @@ -1160,7 +1162,7 @@ def test_fail_extra_reporting(pytester: Pytester, monkeypatch, use_CI) -> None: result.stdout.fnmatch_lines( [ "*test summary*", - f"FAILED test_fail_extra_reporting.py::test_this {use_CI[1]}", + f"FAILED test_fail_extra_reporting.py::test_this {expected_message}", ] )