Remove Testdir.run_example as recommended

This commit is contained in:
Bruno Oliveira 2018-07-26 20:10:40 -03:00
parent 6e57d123bb
commit 57b0c60cb4
2 changed files with 2 additions and 6 deletions

View File

@ -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):

View File

@ -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*")