Skip to content

Commit

Permalink
Add test for pip installing pendulum failing
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Apr 3, 2020
1 parent 655f582 commit 9b7e396
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion tests/installation/test_pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from poetry.repositories.legacy_repository import LegacyRepository
from poetry.repositories.pool import Pool
from poetry.utils._compat import Path
from poetry.utils.env import NullEnv
from poetry.utils.env import NullEnv, VirtualEnv


@pytest.fixture
Expand Down Expand Up @@ -62,6 +62,44 @@ def test_requirement_source_type_url():
assert expected == result


from poetry.factory import Factory
from poetry.utils.env import EnvManager
import shutil


@pytest.fixture()
def poetry(config):
poetry = Factory().create_poetry(
Path(__file__).parent.parent / "fixtures" / "simple_project"
)
poetry.set_config(config)

return poetry


@pytest.fixture()
def manager(poetry):
return EnvManager(poetry)


@pytest.fixture
def tmp_venv(tmp_dir, manager):
venv_path = Path(tmp_dir) / "venv"

manager.build_venv(str(venv_path))

venv = VirtualEnv(venv_path)
yield venv

shutil.rmtree(str(venv.path))


def test_can_install_pendulum_sdist(tmp_venv):
installer = PipInstaller(tmp_venv, NullIO(), Pool())

installer.run('install', '--no-binary', ':all:', 'pendulum')


def test_requirement_git_develop_false(installer, package_git):
package_git.develop = False
result = installer.requirement(package_git)
Expand Down

0 comments on commit 9b7e396

Please sign in to comment.