diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index e75a09db5..5b42b81ee 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -669,11 +669,6 @@ class Testdir(object): else: raise LookupError("example is not found as a file or directory") - def run_example(self, name=None, *pytest_args): - """Runs the given example and returns the results of the run""" - p = self.copy_example(name) - return self.runpytest(p, *pytest_args) - Session = Session def getnode(self, config, arg): diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index b351066a3..487f9b21e 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -5,7 +5,8 @@ import pytest def test_tmpdir_fixture(testdir): - results = testdir.run_example("tmpdir/tmpdir_fixture.py") + p = testdir.copy_example("tmpdir/tmpdir_fixture.py") + results = testdir.runpytest(p) results.stdout.fnmatch_lines("*1 passed*")