-
-
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
issue469: add fix junit double colon split issue #1431
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
|
||
* | ||
|
||
* | ||
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params contain | ||
``::``. | ||
|
||
* | ||
|
||
|
@@ -102,6 +103,7 @@ | |
|
||
.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing | ||
|
||
.. _#469: https://github.com/pytest-dev/pytest/issues/469 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize this is the first time we are formatting the changelog like this, but I think this link would be better placed above the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved in #1432 plus a couple of comments on the changelog. |
||
.. _#1422: https://github.com/pytest-dev/pytest/issues/1422 | ||
.. _#1379: https://github.com/pytest-dev/pytest/issues/1379 | ||
.. _#1366: https://github.com/pytest-dev/pytest/issues/1366 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -449,11 +449,12 @@ def test_function(arg): | |
assert "hello-stderr" in systemout.toxml() | ||
|
||
|
||
def test_mangle_testnames(): | ||
from _pytest.junitxml import mangle_testnames | ||
names = ["a/pything.py", "Class", "()", "method"] | ||
newnames = mangle_testnames(names) | ||
assert newnames == ["a.pything", "Class", "method"] | ||
def test_mangle_test_address(): | ||
from _pytest.junitxml import mangle_test_address | ||
address = '::'.join( | ||
["a/my.py.thing.py", "Class", "()", "method", "[a-1-::]"]) | ||
newnames = mangle_test_address(address) | ||
assert newnames == ["a.my.py.thing", "Class", "method", "[a-1-::]"] | ||
|
||
|
||
def test_dont_configure_on_slaves(tmpdir): | ||
|
@@ -619,6 +620,20 @@ def test_func(char): | |
node.assert_attr(name="test_func[#x00]") | ||
|
||
|
||
def test_double_colon_split_issue469(testdir): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please also add another integration test, this time using a test method instead of a test function? Just to be safe. 😁 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I originally wrote one, but changed by mind! Added in #1432 |
||
testdir.makepyfile(""" | ||
import pytest | ||
@pytest.mark.parametrize('param', ["double::colon"]) | ||
def test_func(param): | ||
pass | ||
""") | ||
result, dom = runandparse(testdir) | ||
assert result.ret == 0 | ||
node = dom.find_first_by_tag("testcase") | ||
node.assert_attr(classname="test_double_colon_split_issue469") | ||
node.assert_attr(name='test_func[double::colon]') | ||
|
||
|
||
def test_unicode_issue368(testdir): | ||
path = testdir.tmpdir.join("test.xml") | ||
log = LogXML(str(path), None) | ||
|
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.
Please add a "Thanks @tomviner" here. 😁