Merge pull request #7303 from nicoddemus/flaky-ini-keys
Show invalid ini keys sorted
This commit is contained in:
commit
5814f77455
|
@ -1074,7 +1074,7 @@ class Config:
|
|||
)
|
||||
|
||||
def _validatekeys(self):
|
||||
for key in self._get_unknown_ini_keys():
|
||||
for key in sorted(self._get_unknown_ini_keys()):
|
||||
message = "Unknown config ini key: {}\n".format(key)
|
||||
if self.known_args_namespace.strict_config:
|
||||
fail(message, pytrace=False)
|
||||
|
|
|
@ -158,10 +158,10 @@ class TestParseIni:
|
|||
""",
|
||||
["unknown_ini", "another_unknown_ini"],
|
||||
[
|
||||
"WARNING: Unknown config ini key: unknown_ini",
|
||||
"WARNING: Unknown config ini key: another_unknown_ini",
|
||||
"WARNING: Unknown config ini key: unknown_ini",
|
||||
],
|
||||
"Unknown config ini key: unknown_ini",
|
||||
"Unknown config ini key: another_unknown_ini",
|
||||
),
|
||||
(
|
||||
"""
|
||||
|
@ -200,9 +200,7 @@ class TestParseIni:
|
|||
):
|
||||
testdir.tmpdir.join("pytest.ini").write(textwrap.dedent(ini_file_text))
|
||||
config = testdir.parseconfig()
|
||||
assert config._get_unknown_ini_keys() == invalid_keys, str(
|
||||
config._get_unknown_ini_keys()
|
||||
)
|
||||
assert sorted(config._get_unknown_ini_keys()) == sorted(invalid_keys)
|
||||
|
||||
result = testdir.runpytest()
|
||||
result.stderr.fnmatch_lines(stderr_output)
|
||||
|
|
Loading…
Reference in New Issue