From 701e78b95665024a15144c4dccdf8f36429183c1 Mon Sep 17 00:00:00 2001 From: Sirui Huang Date: Sun, 28 Apr 2024 20:56:44 -0400 Subject: [PATCH] fix line length issue and modify test --- src/_pytest/python.py | 2 +- testing/test_mark.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 4f7313e6b..9238694c3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1419,7 +1419,7 @@ class Metafunc: actual_param_count = len(argnames) fail( - f"In function {self.function.__name__}: {argnames} is not a valid parameter. " + f"In function {self.function.__name__}: {argnames} is not a valid parameter. \n" f"Expected {expected_param_count} sub parameters, " f"but only {actual_param_count} were provided. \n\n" f"Make sure to pass parameter names as strings without quotes, separated by commas, \n " diff --git a/testing/test_mark.py b/testing/test_mark.py index 46bbf58a7..f9eee67cc 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -421,8 +421,8 @@ def test_parametrized_collect_with_wrong_format(pytester: Pytester) -> None: result = pytester.runpytest(py_file) result.stdout.fnmatch_lines( [ - """In function test_parametrization: ['arg1'] is not a valid parameter. - Expected 2 sub parameters, but only 1 were provided. """, + "In function test_parametrization: ['arg1'] is not a valid parameter. ", + "Expected 2 sub parameters, but only 1 were provided. ", "", "Make sure to pass parameter names as strings without quotes, separated by commas, ", " e.g., '@pytest.mark.parametrize(\"arg1\", )'",