File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -685,6 +685,8 @@ def test_2():
685
685
def test_example_items1 (self , testdir ):
686
686
p = testdir .makepyfile (
687
687
"""
688
+ import pytest
689
+
688
690
def testone():
689
691
pass
690
692
@@ -693,19 +695,24 @@ def testmethod_one(self):
693
695
pass
694
696
695
697
class TestY(TestX):
696
- pass
698
+ @pytest.mark.parametrize("arg0", [".["])
699
+ def testmethod_two(self, arg0):
700
+ pass
697
701
"""
698
702
)
699
703
items , reprec = testdir .inline_genitems (p )
700
- assert len (items ) == 3
704
+ assert len (items ) == 4
701
705
assert items [0 ].name == "testone"
702
706
assert items [1 ].name == "testmethod_one"
703
707
assert items [2 ].name == "testmethod_one"
708
+ assert items [3 ].name == "testmethod_two[.[]"
704
709
705
710
# let's also test getmodpath here
706
711
assert items [0 ].getmodpath () == "testone"
707
712
assert items [1 ].getmodpath () == "TestX.testmethod_one"
708
713
assert items [2 ].getmodpath () == "TestY.testmethod_one"
714
+ # PR #6202: Fix incorrect result of getmodpath method. (Resolves issue #6189)
715
+ assert items [3 ].getmodpath () == "TestY.testmethod_two[.[]"
709
716
710
717
s = items [0 ].getmodpath (stopatmodule = False )
711
718
assert s .endswith ("test_example_items1.testone" )
You can’t perform that action at this time.
0 commit comments