Skip to content

Commit

Permalink
Wrap tmp_path in a pathlib2.Path for compatibility on older Pythons. F…
Browse files Browse the repository at this point in the history
…ixes #10.
  • Loading branch information
jaraco committed Aug 18, 2022
1 parent 2b59823 commit d6ce82d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys

import pytest


if sys.version_info < (3, 10):
import pathlib2 as pathlib # pragma: nocover
else:
import pathlib # pragma: nocover


@pytest.fixture
def tmp_path(tmp_path):
"""
Override tmp_path to wrap in a more modern interface.
"""
return pathlib.Path(tmp_path)
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ testing =
pytest-enabler >= 1.3

# local
pathlib2; python_version < "3.10"

docs =
# upstream
Expand Down

0 comments on commit d6ce82d

Please sign in to comment.