Update tests to resolve some transient resolution issues

Signed-off-by: Dan Ryan <dan@danryan.co>

probably need to sync submodules for this to work

Signed-off-by: Dan Ryan <dan@danryan.co>

Update to new version of artifacts

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix windows failure

Signed-off-by: Dan Ryan <dan@danryan.co>

Update azure-pipelines.yml for Azure Pipelines

Update lockfile test for windows

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix scandir test

Signed-off-by: Dan Ryan <dan@danryan.co>

Update azure test steps

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix virtualenv test

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix python discovery when nothing is supplied

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix cli ensure_project call

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix run in virtualenv test

Signed-off-by: Dan Ryan <dan@danryan.co>

Show why virtualenv test failed if it did

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix python interpreter discovery

Signed-off-by: Dan Ryan <dan@danryan.co>

scale down lock test modifications and increase error logging

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix spinner bugs on windows and python discovery

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix pythonfinder search algorithm to dodge false paths on win

Signed-off-by: Dan Ryan <dan@danryan.co>

use pipenv directly

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2019-05-29 01:38:31 -04:00
parent 401c7c1746
commit 359906c669
22 changed files with 236 additions and 84 deletions
+32 -15
View File
@@ -10,6 +10,7 @@ from pipenv.patched import pipfile
from pipenv.project import Project
from pipenv.utils import temp_environ
from pipenv.vendor.vistir.path import is_in_path
from pipenv.vendor.delegator import run as delegator_run
import pipenv.environments
@@ -173,22 +174,38 @@ def test_include_editable_packages(PipenvInstance, pypi, testsroot, pathlib_tmpd
@pytest.mark.virtualenv
def test_run_in_virtualenv_with_global_context(PipenvInstance, pypi, virtualenv):
with PipenvInstance(chdir=True, pypi=pypi, venv_root=virtualenv.as_posix(), ignore_virtualenvs=False, venv_in_project=False) as p:
c = p.pipenv('run pip freeze')
assert c.return_code == 0
assert 'Creating a virtualenv' not in c.err
c = delegator_run(
"pipenv run pip freeze", cwd=os.path.abspath(p.path),
env=os.environ.copy()
)
assert c.return_code == 0, (c.out, c.err)
assert 'Creating a virtualenv' not in c.err, c.err
project = Project()
assert project.virtualenv_location == virtualenv.as_posix()
c = p.pipenv("run pip install click")
assert c.return_code == 0
assert "Courtesy Notice" in c.err
c = p.pipenv("install six")
assert c.return_code == 0
c = p.pipenv('run python -c "import click;print(click.__file__)"')
assert c.return_code == 0
assert is_in_path(c.out.strip(), str(virtualenv))
c = p.pipenv("clean --dry-run")
assert c.return_code == 0
assert "click" in c.out
assert project.virtualenv_location == virtualenv.as_posix(), (
project.virtualenv_location, virtualenv.as_posix()
)
c = delegator_run(
"pipenv run pip install click", cwd=os.path.abspath(p.path),
env=os.environ.copy()
)
assert c.return_code == 0, (c.out, c.err)
assert "Courtesy Notice" in c.err, (c.out, c.err)
c = delegator_run(
"pipenv install six", cwd=os.path.abspath(p.path), env=os.environ.copy()
)
assert c.return_code == 0, (c.out, c.err)
c = delegator_run(
'pipenv run python -c "import click;print(click.__file__)"',
cwd=os.path.abspath(p.path), env=os.environ.copy()
)
assert c.return_code == 0, (c.out, c.err)
assert is_in_path(c.out.strip(), str(virtualenv)), (c.out.strip(), str(virtualenv))
c = delegator_run(
"pipenv clean --dry-run", cwd=os.path.abspath(p.path),
env=os.environ.copy()
)
assert c.return_code == 0, (c.out, c.err)
assert "click" in c.out, c.out
@pytest.mark.project