issue469: junit parsing nodeid, add method test

This commit is contained in:
TomV 2016-03-03 09:12:56 +00:00
parent 7aa7c6bbfd
commit 3d2b7aeea5
2 changed files with 24 additions and 5 deletions

View File

@ -5,11 +5,15 @@
*
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params contain
``::``.
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs
contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_).
*
.. _#469: https://github.com/pytest-dev/pytest/issues/469
.. _#1431: https://github.com/pytest-dev/pytest/pull/1431
2.9.0
=====
@ -103,7 +107,6 @@
.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing
.. _#469: https://github.com/pytest-dev/pytest/issues/469
.. _#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

View File

@ -620,7 +620,7 @@ def test_escaped_parametrized_names_xml(testdir):
node.assert_attr(name="test_func[#x00]")
def test_double_colon_split_issue469(testdir):
def test_double_colon_split_function_issue469(testdir):
testdir.makepyfile("""
import pytest
@pytest.mark.parametrize('param', ["double::colon"])
@ -630,7 +630,23 @@ def test_double_colon_split_issue469(testdir):
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(classname="test_double_colon_split_function_issue469")
node.assert_attr(name='test_func[double::colon]')
def test_double_colon_split_method_issue469(testdir):
testdir.makepyfile("""
import pytest
class TestClass:
@pytest.mark.parametrize('param', ["double::colon"])
def test_func(self, 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_method_issue469.TestClass")
node.assert_attr(name='test_func[double::colon]')