Skip to content

Commit 57b0c60

Browse files
committed
Remove Testdir.run_example as recommended
1 parent 6e57d12 commit 57b0c60

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/_pytest/pytester.py

-5
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,6 @@ def copy_example(self, name=None):
669669
else:
670670
raise LookupError("example is not found as a file or directory")
671671

672-
def run_example(self, name=None, *pytest_args):
673-
"""Runs the given example and returns the results of the run"""
674-
p = self.copy_example(name)
675-
return self.runpytest(p, *pytest_args)
676-
677672
Session = Session
678673

679674
def getnode(self, config, arg):

testing/test_tmpdir.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66

77
def test_tmpdir_fixture(testdir):
8-
results = testdir.run_example("tmpdir/tmpdir_fixture.py")
8+
p = testdir.copy_example("tmpdir/tmpdir_fixture.py")
9+
results = testdir.runpytest(p)
910
results.stdout.fnmatch_lines("*1 passed*")
1011

1112

0 commit comments

Comments
 (0)