Skip to content

Commit

Permalink
bring in purepath and fix an assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 19, 2018
1 parent 76bd4cc commit 6753ba5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/_pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Only available in Python 3.4+ or as a backport
enum = None

__all__ = ["Path"]
__all__ = ["Path", "PurePath"]

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

if PY36:
from pathlib import Path
from pathlib import Path, PurePath
else:
from pathlib2 import Path
from pathlib2 import Path, PurePath


if _PY3:
Expand Down
3 changes: 3 additions & 0 deletions src/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
RemovedInPytest4Warning,
PytestExperimentalApiWarning,
)
from _pytest.compat import Path, PurePath

set_trace = __pytestPDB.set_trace

Expand Down Expand Up @@ -67,6 +68,8 @@
"warns",
"xfail",
"yield_fixture",
"Path",
"PurePath",
]

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion testing/test_tmpdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_tmpdir_factory(testdir):
def session_dir(tmpdir_factory):
return tmpdir_factory.mktemp('data', numbered=False)
def test_some(session_dir):
session_dir.isdir()
assert session_dir.isdir()
"""
)
reprec = testdir.inline_run()
Expand Down

0 comments on commit 6753ba5

Please sign in to comment.