Skip to content

Use pathlib2 #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sys
import types

import pathlib
import pytest

from .django_compat import is_django_unittest # noqa
Expand All @@ -38,6 +37,11 @@

from .lazy_django import django_settings_is_configured, skip_if_no_django

try:
import pathlib
except ImportError:
import pathlib2 as pathlib


SETTINGS_MODULE_ENV = 'DJANGO_SETTINGS_MODULE'
CONFIGURATION_ENV = 'DJANGO_CONFIGURATION'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def read(fname):
setup_requires=['setuptools_scm>=1.11.1'],
install_requires=[
'pytest>=3.6',
'pathlib;python_version<"3.4"',
'pathlib2;python_version<"3.4"',
],
extras_require={
'docs': [
Expand Down
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
import shutil
from textwrap import dedent

import pathlib
import pytest
import six
from django.conf import settings

from pytest_django_test.db_helpers import DB_NAME, TEST_DB_NAME

try:
import pathlib
except ImportError:
import pathlib2 as pathlib

pytest_plugins = 'pytester'

REPOSITORY_ROOT = pathlib.Path(__file__).parent
Expand Down