@@ -933,11 +933,11 @@ def test_setup_only_available_in_subdir(pytester: Pytester) -> None:
933
933
"""\
934
934
import pytest
935
935
def pytest_runtest_setup(item):
936
- assert item.fspath.purebasename == "test_in_sub1"
936
+ assert item.path.stem == "test_in_sub1"
937
937
def pytest_runtest_call(item):
938
- assert item.fspath.purebasename == "test_in_sub1"
938
+ assert item.path.stem == "test_in_sub1"
939
939
def pytest_runtest_teardown(item):
940
- assert item.fspath.purebasename == "test_in_sub1"
940
+ assert item.path.stem == "test_in_sub1"
941
941
"""
942
942
)
943
943
)
@@ -946,11 +946,11 @@ def pytest_runtest_teardown(item):
946
946
"""\
947
947
import pytest
948
948
def pytest_runtest_setup(item):
949
- assert item.fspath.purebasename == "test_in_sub2"
949
+ assert item.path.stem == "test_in_sub2"
950
950
def pytest_runtest_call(item):
951
- assert item.fspath.purebasename == "test_in_sub2"
951
+ assert item.path.stem == "test_in_sub2"
952
952
def pytest_runtest_teardown(item):
953
- assert item.fspath.purebasename == "test_in_sub2"
953
+ assert item.path.stem == "test_in_sub2"
954
954
"""
955
955
)
956
956
)
@@ -1125,8 +1125,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
1125
1125
def test_func_reportinfo (self , pytester : Pytester ) -> None :
1126
1126
item = pytester .getitem ("def test_func(): pass" )
1127
1127
fspath , lineno , modpath = item .reportinfo ()
1128
- with pytest .warns (DeprecationWarning ):
1129
- assert fspath == item .fspath
1128
+ assert str (fspath ) == str (item .path )
1130
1129
assert lineno == 0
1131
1130
assert modpath == "test_func"
1132
1131
@@ -1141,8 +1140,7 @@ def test_hello(self): pass
1141
1140
classcol = pytester .collect_by_name (modcol , "TestClass" )
1142
1141
assert isinstance (classcol , Class )
1143
1142
fspath , lineno , msg = classcol .reportinfo ()
1144
- with pytest .warns (DeprecationWarning ):
1145
- assert fspath == modcol .fspath
1143
+ assert str (fspath ) == str (modcol .path )
1146
1144
assert lineno == 1
1147
1145
assert msg == "TestClass"
1148
1146
0 commit comments