Skip to content

Commit c8ca1d1

Browse files
committed
Merge pull request #1432 from tomviner/issue469-junit-double-colon
issue469: junit parsing nodeid, add method test
2 parents 7aa7c6b + 3d2b7ae commit c8ca1d1

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55

66
*
77

8-
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params contain
9-
``::``.
8+
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs
9+
contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_).
1010

1111
*
1212

13+
.. _#469: https://github.com/pytest-dev/pytest/issues/469
14+
.. _#1431: https://github.com/pytest-dev/pytest/pull/1431
15+
16+
1317
2.9.0
1418
=====
1519

@@ -103,7 +107,6 @@
103107

104108
.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing
105109

106-
.. _#469: https://github.com/pytest-dev/pytest/issues/469
107110
.. _#1422: https://github.com/pytest-dev/pytest/issues/1422
108111
.. _#1379: https://github.com/pytest-dev/pytest/issues/1379
109112
.. _#1366: https://github.com/pytest-dev/pytest/issues/1366

testing/test_junitxml.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def test_func(char):
620620
node.assert_attr(name="test_func[#x00]")
621621

622622

623-
def test_double_colon_split_issue469(testdir):
623+
def test_double_colon_split_function_issue469(testdir):
624624
testdir.makepyfile("""
625625
import pytest
626626
@pytest.mark.parametrize('param', ["double::colon"])
@@ -630,7 +630,23 @@ def test_func(param):
630630
result, dom = runandparse(testdir)
631631
assert result.ret == 0
632632
node = dom.find_first_by_tag("testcase")
633-
node.assert_attr(classname="test_double_colon_split_issue469")
633+
node.assert_attr(classname="test_double_colon_split_function_issue469")
634+
node.assert_attr(name='test_func[double::colon]')
635+
636+
637+
def test_double_colon_split_method_issue469(testdir):
638+
testdir.makepyfile("""
639+
import pytest
640+
class TestClass:
641+
@pytest.mark.parametrize('param', ["double::colon"])
642+
def test_func(self, param):
643+
pass
644+
""")
645+
result, dom = runandparse(testdir)
646+
assert result.ret == 0
647+
node = dom.find_first_by_tag("testcase")
648+
node.assert_attr(
649+
classname="test_double_colon_split_method_issue469.TestClass")
634650
node.assert_attr(name='test_func[double::colon]')
635651

636652

0 commit comments

Comments
 (0)