Skip to content

Commit

Permalink
Fix test references to old requirements parser
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Apr 23, 2018
1 parent 82c4e59 commit 9eec96d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pipenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
pass_context,
Option,
version_option,
BadParameter,
)
from click_completion import init as init_completion
from click_completion import get_code
Expand Down Expand Up @@ -75,7 +76,7 @@ def validate_python_path(ctx, param, value):
# we'll report absolute paths which do not exist:
if isinstance(value, (str, bytes)):
if os.path.isabs(value) and not os.path.isfile(value):
raise click.BadParameter('Expected Python at path %s does not exist' % value)
raise BadParameter('Expected Python at path %s does not exist' % value)
return value


Expand Down
1 change: 0 additions & 1 deletion pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,6 @@ def remove_package_from_pipfile(self, package_name, dev=False):
self.write_toml(p)

def add_package_to_pipfile(self, package_name, dev=False):
from .utils import convert_deps_from_pip
# Read and append Pipfile.
p = self.parsed_pipfile
# Don't re-capitalize file URLs or VCSs.
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Pipfile format <-> requirements.txt format.
DEP_PIP_PAIRS = [
({'requests': '*'}, 'requests'),
({'requests': {'extras': ['socks']}}, 'requests[socks]'),
({'requests': {'extras': ['socks'], 'version': '*'}}, 'requests[socks]'),
({'django': '>1.10'}, 'django>1.10'),
({'Django': '>1.10'}, 'Django>1.10'),
(
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_convert_deps_to_pip_unicode():
@pytest.mark.utils
@pytest.mark.parametrize('expected, requirement', DEP_PIP_PAIRS)
def test_convert_from_pip(expected, requirement):
assert pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile() == expected
assert pipenv.requirements.PipenvRequirement.from_line(requirement).as_pipfile() == expected


@pytest.mark.utils
Expand All @@ -111,7 +111,7 @@ def test_convert_from_pip_fail_if_no_egg():
"""
dep = 'git+https://github.com/kennethreitz/requests.git'
with pytest.raises(ValueError) as e:
dep = pipenv.utils.convert_deps_from_pip(dep)
dep = pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile()
assert 'pipenv requires an #egg fragment for vcs' in str(e)


Expand All @@ -120,7 +120,7 @@ def test_convert_from_pip_git_uri_normalize():
"""Pip does not parse this correctly, but we can (by converting to ssh://).
"""
dep = 'git+git@host:user/repo.git#egg=myname'
dep = pipenv.utils.convert_deps_from_pip(dep)
dep = pipenv.requirements.PipenvRequirement.from_line(dep).as_pipfile()
assert dep == {
'myname': {
'git': 'git@host:user/repo.git',
Expand Down

0 comments on commit 9eec96d

Please sign in to comment.