diff options
author | Anthony Sottile <asottile@umich.edu> | 2020-07-26 17:56:06 -0700 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2020-07-26 17:57:25 -0700 |
commit | 9818899df4eacb65a4ec1397a93b5ebcf43e825c (patch) | |
tree | d2deaebd8dcb547b3c69eeedf91ee66a5c9ad4f8 /doc/en/example | |
parent | 3a060b77e81ebf990159e59cc8f8de26ad998e12 (diff) | |
download | pytest-9818899df4eacb65a4ec1397a93b5ebcf43e825c.tar.gz |
remove usage of pylib in docs
Diffstat (limited to 'doc/en/example')
-rw-r--r-- | doc/en/example/assertion/global_testmodule_config/conftest.py | 4 | ||||
-rw-r--r-- | doc/en/example/assertion/test_failures.py | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/doc/en/example/assertion/global_testmodule_config/conftest.py b/doc/en/example/assertion/global_testmodule_config/conftest.py index da89047fe..fd467f09e 100644 --- a/doc/en/example/assertion/global_testmodule_config/conftest.py +++ b/doc/en/example/assertion/global_testmodule_config/conftest.py @@ -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): diff --git a/doc/en/example/assertion/test_failures.py b/doc/en/example/assertion/test_failures.py index 30ebc72dc..eda06dfc5 100644 --- a/doc/en/example/assertion/test_failures.py +++ b/doc/en/example/assertion/test_failures.py @@ -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 |