mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
c31a311dc7
Signed-off-by: Dan Ryan <dan@danryan.co> Add pytz and certifi updates Signed-off-by: Dan Ryan <dan@danryan.co> Fix nondeterministic resolution bug - Update dependencies - Fix some issues with test logic - Update piptools patch Signed-off-by: Dan Ryan <dan@danryan.co> Update more packages Signed-off-by: Dan Ryan <dan@danryan.co> Update tests and utils Signed-off-by: Dan Ryan <dan@danryan.co> Still need to tackle last few failures - this will seriously help with resolution issues Add alembic new version Signed-off-by: Dan Ryan <dan@danryan.co>
64 lines
1.7 KiB
Python
64 lines
1.7 KiB
Python
import os
|
|
|
|
from pipenv.utils import temp_environ
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.sync
|
|
def test_sync_error_without_lockfile(PipenvInstance, pypi):
|
|
with PipenvInstance(pypi=pypi) as p:
|
|
with open(p.pipfile_path, 'w') as f:
|
|
f.write("""
|
|
[packages]
|
|
""".strip())
|
|
|
|
c = p.pipenv('sync')
|
|
assert c.return_code != 0
|
|
assert 'Pipfile.lock is missing!' in c.err
|
|
|
|
|
|
@pytest.mark.sync
|
|
@pytest.mark.lock
|
|
def test_mirror_lock_sync(PipenvInstance, pypi):
|
|
with temp_environ(), PipenvInstance(chdir=True) as p:
|
|
mirror_url = os.environ.pop('PIPENV_TEST_INDEX', "https://pypi.kennethreitz..org/simple")
|
|
assert 'pypi.org' not in mirror_url
|
|
with open(p.pipfile_path, 'w') as f:
|
|
f.write("""
|
|
[packages]
|
|
six = "*"
|
|
""".strip())
|
|
c = p.pipenv('lock --pypi-mirror {0}'.format(mirror_url))
|
|
assert c.return_code == 0
|
|
c = p.pipenv('sync --pypi-mirror {0}'.format(mirror_url))
|
|
assert c.return_code == 0
|
|
|
|
|
|
@pytest.mark.sync
|
|
@pytest.mark.lock
|
|
def test_sync_should_not_lock(PipenvInstance, pypi):
|
|
"""Sync should not touch the lock file, even if Pipfile is changed.
|
|
"""
|
|
with PipenvInstance(pypi=pypi) as p:
|
|
with open(p.pipfile_path, 'w') as f:
|
|
f.write("""
|
|
[packages]
|
|
""".strip())
|
|
|
|
# Perform initial lock.
|
|
c = p.pipenv('lock')
|
|
assert c.return_code == 0
|
|
lockfile_content = p.lockfile
|
|
assert lockfile_content
|
|
|
|
# Make sure sync does not trigger lockfile update.
|
|
with open(p.pipfile_path, 'w') as f:
|
|
f.write("""
|
|
[packages]
|
|
six = "*"
|
|
""".strip())
|
|
c = p.pipenv('sync')
|
|
assert c.return_code == 0
|
|
assert lockfile_content == p.lockfile
|