From a6ac0b5fb0e1b6e9cb33024511ade0503c3c4cfd Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sun, 15 Mar 2020 04:45:29 +0800 Subject: [PATCH] Fix test failure of test_installed_from_venv when running with pytest-runner Passing PYTHONPATH here fixes the module not found error when running with pytest-runner without pre-commit installed first. --- tests/commands/install_uninstall_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py index 66b91903..7e037584 100644 --- a/tests/commands/install_uninstall_test.py +++ b/tests/commands/install_uninstall_test.py @@ -530,6 +530,8 @@ def test_installed_from_venv(tempdir_factory, store): 'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'], 'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'], 'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'], + # Pass PYTHONPATH to support running tests using pytest-runner + 'PYTHONPATH': os.environ.get('PYTHONPATH', ''), }, ) assert ret == 0