Skip to content

Commit 3c7eb5a

Browse files
author
crricks
authored
migrated test_nodes.py from testdir to pytester #7492. (#7969)
1 parent ad94456 commit 3c7eb5a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testing/test_nodes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66
from _pytest import nodes
7-
from _pytest.pytester import Testdir
7+
from _pytest.pytester import Pytester
88

99

1010
@pytest.mark.parametrize(
@@ -35,8 +35,8 @@ def test_node_from_parent_disallowed_arguments() -> None:
3535
nodes.Node.from_parent(None, config=None) # type: ignore[arg-type]
3636

3737

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(
4040
"""
4141
def test():
4242
pass
@@ -66,12 +66,12 @@ class FakeSession2:
6666
assert nodes._check_initialpaths_for_relpath(FakeSession2, outside) is None
6767

6868

69-
def test_failure_with_changed_cwd(testdir):
69+
def test_failure_with_changed_cwd(pytester: Pytester) -> None:
7070
"""
7171
Test failure lines should use absolute paths if cwd has changed since
7272
invocation, so the path is correct (#6428).
7373
"""
74-
p = testdir.makepyfile(
74+
p = pytester.makepyfile(
7575
"""
7676
import os
7777
import pytest
@@ -89,5 +89,5 @@ def test_show_wrong_path(private_dir):
8989
assert False
9090
"""
9191
)
92-
result = testdir.runpytest()
92+
result = pytester.runpytest()
9393
result.stdout.fnmatch_lines([str(p) + ":*: AssertionError", "*1 failed in *"])

0 commit comments

Comments
 (0)