From 4a772b5194262fdbe61db6d7ae03ddb70707f3cc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 31 Oct 2021 08:54:33 -0400 Subject: [PATCH] perf(test): run pip just once, shaves 1.2s off the fixture ... though that means it's 8.1s instead of 9.3s, so still pretty slow. --- tests/test_venv.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/test_venv.py b/tests/test_venv.py index dfe10b591..f3455411d 100644 --- a/tests/test_venv.py +++ b/tests/test_venv.py @@ -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