Skip to content

Commit 6753ba5

Browse files
bring in purepath and fix an assertion
1 parent 76bd4cc commit 6753ba5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/_pytest/compat.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Only available in Python 3.4+ or as a backport
2424
enum = None
2525

26-
__all__ = ["Path"]
26+
__all__ = ["Path", "PurePath"]
2727

2828
_PY3 = sys.version_info > (3, 0)
2929
_PY2 = not _PY3
@@ -42,9 +42,9 @@
4242
MODULE_NOT_FOUND_ERROR = "ModuleNotFoundError" if PY36 else "ImportError"
4343

4444
if PY36:
45-
from pathlib import Path
45+
from pathlib import Path, PurePath
4646
else:
47-
from pathlib2 import Path
47+
from pathlib2 import Path, PurePath
4848

4949

5050
if _PY3:

src/pytest.py

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
RemovedInPytest4Warning,
2727
PytestExperimentalApiWarning,
2828
)
29+
from _pytest.compat import Path, PurePath
2930

3031
set_trace = __pytestPDB.set_trace
3132

@@ -67,6 +68,8 @@
6768
"warns",
6869
"xfail",
6970
"yield_fixture",
71+
"Path",
72+
"PurePath",
7073
]
7174

7275
if __name__ == "__main__":

testing/test_tmpdir.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_tmpdir_factory(testdir):
111111
def session_dir(tmpdir_factory):
112112
return tmpdir_factory.mktemp('data', numbered=False)
113113
def test_some(session_dir):
114-
session_dir.isdir()
114+
assert session_dir.isdir()
115115
"""
116116
)
117117
reprec = testdir.inline_run()

0 commit comments

Comments
 (0)