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.
This commit is contained in:
Felix Yan 2020-03-15 04:45:29 +08:00 committed by GitHub
parent bb6f1efe63
commit a6ac0b5fb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -530,6 +530,8 @@ def test_installed_from_venv(tempdir_factory, store):
'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'], 'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'],
'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'], 'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'],
'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_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 assert ret == 0