4
4
5
5
import pytest
6
6
from _pytest import nodes
7
- from _pytest .pytester import Testdir
7
+ from _pytest .pytester import Pytester
8
8
9
9
10
10
@pytest .mark .parametrize (
@@ -35,8 +35,8 @@ def test_node_from_parent_disallowed_arguments() -> None:
35
35
nodes .Node .from_parent (None , config = None ) # type: ignore[arg-type]
36
36
37
37
38
- def test_std_warn_not_pytestwarning (testdir : Testdir ) -> None :
39
- items = testdir .getitems (
38
+ def test_std_warn_not_pytestwarning (pytester : Pytester ) -> None :
39
+ items = pytester .getitems (
40
40
"""
41
41
def test():
42
42
pass
@@ -66,12 +66,12 @@ class FakeSession2:
66
66
assert nodes ._check_initialpaths_for_relpath (FakeSession2 , outside ) is None
67
67
68
68
69
- def test_failure_with_changed_cwd (testdir ) :
69
+ def test_failure_with_changed_cwd (pytester : Pytester ) -> None :
70
70
"""
71
71
Test failure lines should use absolute paths if cwd has changed since
72
72
invocation, so the path is correct (#6428).
73
73
"""
74
- p = testdir .makepyfile (
74
+ p = pytester .makepyfile (
75
75
"""
76
76
import os
77
77
import pytest
@@ -89,5 +89,5 @@ def test_show_wrong_path(private_dir):
89
89
assert False
90
90
"""
91
91
)
92
- result = testdir .runpytest ()
92
+ result = pytester .runpytest ()
93
93
result .stdout .fnmatch_lines ([str (p ) + ":*: AssertionError" , "*1 failed in *" ])
0 commit comments