mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
@@ -1,5 +1,6 @@
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from pipenv.utils import temp_environ
|
||||
|
||||
@@ -517,3 +518,25 @@ def test_lock_no_warnings(PipenvInstance, pypi):
|
||||
assert "Warning" in c.err
|
||||
assert "Warning" not in c.out
|
||||
assert "hello" in c.out
|
||||
|
||||
|
||||
@pytest.mark.lock
|
||||
@pytest.mark.install
|
||||
@pytest.mark.skipif(sys.version_info >= (3, 5), reason="scandir doesn't get installed on python 3.5+")
|
||||
def test_lock_missing_cache_entries_gets_all_hashes(monkeypatch, PipenvInstance, pypi, tmpdir):
|
||||
"""
|
||||
Test locking pathlib2 on python2.7 which needs `scandir`, but fails to resolve when
|
||||
using a fresh dependency cache.
|
||||
"""
|
||||
|
||||
with monkeypatch.context() as m:
|
||||
monkeypatch.setattr("pipenv.patched.piptools.locations.CACHE_DIR", tmpdir.strpath)
|
||||
with PipenvInstance(pypi=pypi, chdir=True) as p:
|
||||
p._pipfile.add("pathlib2", "*")
|
||||
assert "pathlib2" in p.pipfile["packages"]
|
||||
c = p.pipenv("install")
|
||||
assert c.return_code == 0, c.err
|
||||
assert "pathlib2" in p.lockfile["default"]
|
||||
assert "scandir" in p.lockfile["default"]
|
||||
assert isinstance(p.lockfile["default"]["scandir"]["hashes"], list)
|
||||
assert len(p.lockfile["default"]["scandir"]["hashes"]) > 1
|
||||
|
||||
Reference in New Issue
Block a user