fix line length issue and modify test

This commit is contained in:
Sirui Huang 2024-04-28 20:56:44 -04:00
parent 938de1b623
commit 701e78b956
2 changed files with 3 additions and 3 deletions

View File

@ -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 "

View File

@ -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\", <Input Values>)'",