Merge pull request #7545 from asottile/pylib_in_docs

remove usage of pylib in docs
This commit is contained in:
Anthony Sottile 2020-07-27 09:36:58 -07:00 committed by GitHub
commit c2c0b7a542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,8 @@
import py
import os.path
import pytest
mydir = py.path.local(__file__).dirpath()
mydir = os.path.dirname(__file__)
def pytest_runtest_setup(item):

View File

@ -1,13 +1,13 @@
import py
import os.path
import shutil
failure_demo = py.path.local(__file__).dirpath("failure_demo.py")
failure_demo = os.path.join(os.path.dirname(__file__), "failure_demo.py")
pytest_plugins = ("pytester",)
def test_failure_demo_fails_properly(testdir):
target = testdir.tmpdir.join(failure_demo.basename)
failure_demo.copy(target)
failure_demo.copy(testdir.tmpdir.join(failure_demo.basename))
target = testdir.tmpdir.join(os.path.basename(failure_demo))
shutil.copy(failure_demo, target)
result = testdir.runpytest(target, syspathinsert=True)
result.stdout.fnmatch_lines(["*44 failed*"])
assert result.ret != 0