Skip to content

Commit aac97ef

Browse files
committed
test_same_nodeids
1 parent f606077 commit aac97ef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

testing/test_terminal.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,26 +1598,26 @@ def test_normal(self, many_tests_files, testdir):
15981598
)
15991599

16001600
def test_same_nodeids(self, testdir: Testdir) -> None:
1601+
p1 = testdir.makeconftest(
1602+
"""
1603+
def pytest_collection_modifyitems(items):
1604+
assert len(items) == 2
1605+
items[1]._nodeid = items[0].nodeid
1606+
"""
1607+
)
16011608
p1 = testdir.makepyfile(
16021609
"""
1603-
import pytest
1604-
1605-
@pytest.mark.parametrize("v", ["", " "])
1606-
@pytest.mark.parametrize("w", ["", " "])
1607-
def test(v, w):
1608-
pass
1610+
def test1(): pass
1611+
def test2(): pass
16091612
"""
16101613
)
16111614
result = testdir.runpytest("-v", str(p1))
1612-
trans = str.maketrans({"[": "[[]", "]": "[]]"})
16131615
result.stdout.fnmatch_lines(
16141616
[
1615-
line.translate(trans)
1617+
line.translate(TRANS_FNMATCH)
16161618
for line in [
1617-
"test_same_nodeids.py::test[] PASSED * [ 25%]",
1618-
"test_same_nodeids.py::test[ ] PASSED * [ 50%]",
1619-
"test_same_nodeids.py::test[ ] PASSED * [ 75%]",
1620-
"test_same_nodeids.py::test[ - ] PASSED * [100%]",
1619+
"test_same_nodeids.py::test1 PASSED * [50%]",
1620+
"test_same_nodeids.py::test2 PASSED * [100%]",
16211621
]
16221622
]
16231623
)

0 commit comments

Comments
 (0)