(tempdir_factory, store)
| 524 | |
| 525 | |
| 526 | def test_installed_from_venv(tempdir_factory, store): |
| 527 | path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') |
| 528 | with cwd(path): |
| 529 | install(C.CONFIG_FILE, store, hook_types=['pre-commit']) |
| 530 | # No environment so pre-commit is not on the path when running! |
| 531 | # Should still pick up the python from when we installed |
| 532 | ret, output = _get_commit_output( |
| 533 | tempdir_factory, |
| 534 | env={ |
| 535 | 'HOME': os.path.expanduser('~'), |
| 536 | 'PATH': _path_without_us(), |
| 537 | 'TERM': os.environ.get('TERM', ''), |
| 538 | # Windows needs this to import `random` |
| 539 | 'SYSTEMROOT': os.environ.get('SYSTEMROOT', ''), |
| 540 | # Windows needs this to resolve executables |
| 541 | 'PATHEXT': os.environ.get('PATHEXT', ''), |
| 542 | # Git needs this to make a commit |
| 543 | 'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'], |
| 544 | 'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'], |
| 545 | 'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'], |
| 546 | 'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'], |
| 547 | }, |
| 548 | ) |
| 549 | assert ret == 0 |
| 550 | NORMAL_PRE_COMMIT_RUN.assert_matches(output) |
| 551 | |
| 552 | |
| 553 | def _get_push_output(tempdir_factory, remote='origin', opts=()): |
nothing calls this directly
no test coverage detected