Skip to content

Commit

Permalink
Merge pull request #491 from betatim/fix-integration-test-new-pip
Browse files Browse the repository at this point in the history
[MRG] Fix integration test for new pip
  • Loading branch information
GeorgianaElena committed Jan 26, 2020
2 parents 386683b + aa2222c commit 5aa4637
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions integration-tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def test_installer_log_readable():
assert file_stat.st_uid == 0
assert file_stat.st_mode == 0o100500


@pytest.mark.parametrize("group", [ADMIN_GROUP, USER_GROUP])
def test_user_env_readable(group):
# every file in user env should be readable by everyone
Expand Down Expand Up @@ -163,8 +164,15 @@ def test_pip_install(group, allowed):
python = os.path.join(USER_PREFIX, "bin", "python")

with context:
# we explicitly add `--no-user` here even though a real user wouldn't
# With this test we want to check that a user can't install to the
# global site-packages directory. In new versions of pip the default
# behaviour is to install to a user location when a global install
# isn't possible. By using --no-user we disable this behaviour and
# get a failure if the user can't install to the global site. Which is
# what we wanted to test for here.
subprocess.check_call(
[python, "-m", "pip", "install", "--ignore-installed", "--no-deps", "flit"],
[python, "-m", "pip", "install", "--no-user", "--ignore-installed", "--no-deps", "flit"],
preexec_fn=partial(setgroup, group),
)
if allowed:
Expand Down Expand Up @@ -199,6 +207,7 @@ def test_pip_upgrade(group, allowed):
"-m",
"pip",
"install",
"--no-user",
"--ignore-installed",
"--no-deps",
"testpath==0.3.0",
Expand All @@ -211,8 +220,9 @@ def test_pip_upgrade(group, allowed):
preexec_fn=partial(setgroup, group),
)


def test_symlinks():
"""
Test we symlink tljh-config to /usr/local/bin
"""
assert os.path.exists('/usr/bin/tljh-config')
assert os.path.exists('/usr/bin/tljh-config')

0 comments on commit 5aa4637

Please sign in to comment.