Skip to content

Commit

Permalink
perf(test): run pip just once, shaves 1.2s off the fixture
Browse files Browse the repository at this point in the history
... though that means it's 8.1s instead of 9.3s, so still pretty slow.
  • Loading branch information
nedbat committed Oct 31, 2021
1 parent adff230 commit 4a772b5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ def testp():
print("Plugin here")
""")

# Install the third-party packages.
run_in_venv("python -m pip install --no-index ./third_pkg")
run_in_venv("python -m pip install --no-index -e ./another_pkg")
run_in_venv("python -m pip install --no-index -e ./bug888/app -e ./bug888/plugin")
shutil.rmtree("third_pkg")

# Install coverage.
# Install everything.
coverage_src = nice_file(TESTS_DIR, "..")
run_in_venv(f"python -m pip install --no-index {coverage_src}")
run_in_venv(
"python -m pip install --no-index " +
"./third_pkg " +
"-e ./another_pkg " +
"-e ./bug888/app -e ./bug888/plugin " +
coverage_src
)
shutil.rmtree("third_pkg")

return venv_world

Expand Down

0 comments on commit 4a772b5

Please sign in to comment.