Merge pull request #5128 from blueyed/mark-is

Fix error message with unregistered markers
This commit is contained in:
Daniel Hahler 2019-04-15 16:23:54 +02:00 committed by GitHub
commit 45ba736c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -312,7 +312,7 @@ class MarkGenerator(object):
# then it really is time to issue a warning or an error. # then it really is time to issue a warning or an error.
if name not in self._markers: if name not in self._markers:
if self._config.option.strict: if self._config.option.strict:
fail("{!r} not a registered marker".format(name), pytrace=False) fail("{!r} is not a registered marker".format(name), pytrace=False)
else: else:
warnings.warn( warnings.warn(
"Unknown pytest.mark.%s - is this a typo? You can register " "Unknown pytest.mark.%s - is this a typo? You can register "

View File

@ -205,7 +205,7 @@ def test_strict_prohibits_unregistered_markers(testdir):
) )
result = testdir.runpytest("--strict") result = testdir.runpytest("--strict")
assert result.ret != 0 assert result.ret != 0
result.stdout.fnmatch_lines(["'unregisteredmark' not a registered marker"]) result.stdout.fnmatch_lines(["'unregisteredmark' is not a registered marker"])
@pytest.mark.parametrize( @pytest.mark.parametrize(