Update references to Path

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-06-27 22:28:31 -04:00
parent 24743f77d3
commit 39a363b780
6 changed files with 10 additions and 30 deletions
+1 -7
View File
@@ -4,18 +4,12 @@ import warnings
import pytest
from pipenv._compat import TemporaryDirectory
from pipenv._compat import TemporaryDirectory, Path
from pipenv.vendor import delegator
from pipenv.vendor import requests
from pipenv.vendor import six
from pipenv.vendor import toml
try:
from pathlib import Path
except ImportError:
from pipenv.vendor.pathlib2 import Path
if six.PY2:
class ResourceWarning(Warning):
pass
+1 -5
View File
@@ -2,13 +2,9 @@ import contextlib
import os
from pipenv.utils import temp_environ
from pipenv._compat import TemporaryDirectory
from pipenv._compat import TemporaryDirectory, Path
from pipenv.vendor import delegator
from pipenv.project import Project
try:
from pathlib import Path
except ImportError:
from pipenv.vendor.pathlib2 import Path
import pytest
+2 -5
View File
@@ -1,10 +1,7 @@
import os
import shutil
from pipenv.project import Project
try:
import pathlib
except ImportError:
import pathlib2 as pathlib
from pipenv._compat import Path
from pipenv.utils import mkdir_p, temp_environ
@@ -223,7 +220,7 @@ def test_relative_paths(PipenvInstance, pypi, testsroot):
dep = p.pipfile['packages'][key]
assert 'path' in dep
assert pathlib.Path('.', artifact_dir, file_name) == pathlib.Path(dep['path'])
assert Path('.', artifact_dir, file_name) == Path(dep['path'])
assert c.return_code == 0
+1 -4
View File
@@ -2,10 +2,7 @@ import pytest
import os
from flaky import flaky
import delegator
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
from pipenv._compat import Path
@pytest.mark.vcs
+2 -6
View File
@@ -11,11 +11,7 @@ import pytest
from pipenv.core import activate_virtualenv
from pipenv.project import Project
from pipenv.vendor import delegator
try:
from pathlib import Path
except ImportError:
from pipenv.vendor.pathlib2 import Path
from pipenv._compat import Path
@pytest.mark.code
@@ -123,4 +119,4 @@ def test_directory_with_leading_dash(PipenvInstance):
assert os.path.isdir(venv_path)
# Manually clean up environment, since PipenvInstance assumes that
# the virutalenv is in the project directory.
p.pipenv('--rm')
p.pipenv('--rm')
+3 -3
View File
@@ -1,7 +1,7 @@
import os
from pipenv.project import Project
from pipenv.vendor import pathlib2 as pathlib
from pipenv._compat import Path
import pytest
@@ -33,7 +33,7 @@ def test_case_changes_windows(PipenvInstance, pypi):
@pytest.mark.files
def test_local_path_windows(PipenvInstance, pypi):
whl = (
pathlib.Path(__file__).parent.parent
Path(__file__).parent.parent
.joinpath('pypi', 'six', 'six-1.11.0-py2.py3-none-any.whl')
)
try:
@@ -48,7 +48,7 @@ def test_local_path_windows(PipenvInstance, pypi):
@pytest.mark.files
def test_local_path_windows_forward_slash(PipenvInstance, pypi):
whl = (
pathlib.Path(__file__).parent.parent
Path(__file__).parent.parent
.joinpath('pypi', 'six', 'six-1.11.0-py2.py3-none-any.whl')
)
try: