-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip whitespace from markers in INI config #2867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given the simplicity of the solution it seems ok to go for a bugfix
CC @nicoddemus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Please add a CHANGELOG entry and we can merge this. 👍
CHANGELOG.rst
Outdated
@@ -25,6 +25,9 @@ Bug Fixes | |||
_fixtureinfo attribute (e.g. doctests) (`#2788 | |||
<https://github.com/pytest-dev/pytest/issues/2788>`_) | |||
|
|||
- Strip whitespace from the markers in INI config (`#2856 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use towncrier
for changelog management to avoid conflicts, so instead of this please create a file changelog/2856.bugfix
with this text:
Strip whitespace from marker names when reading them from INI config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry! I should have paid more attention.
bbb7635
to
52aadcd
Compare
For consistency, do you also have to update this section? Although I haven't looked into why this one does not split on |
@bilderbuchi I guess |
For what it's worth, this change causes pytest to break in a non obvious way when there's a line without a colon, for example if the description of a marker was wrapped such as:
|
@pquentin I reverted the merge, but this doesn't work: def test_markers_option(testdir):
testdir.makeini("""
[pytest]
markers =
a1: this is a webtest marker
a1some: another marker
a1multi: another marker
with stuff
""")
result = testdir.runpytest("--markers", )
result.stdout.fnmatch_lines([
"*a1*this is a webtest*",
"*a1some*another marker",
"*a1multi*another marker*with stuff",
])
|
@pquentin could you please open an issue describing the problem, including the error message you are getting? We can continue this discussion from there then. Thanks! |
Attempts to resolve #2856.