diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-09 06:23:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-09 06:23:31 +0000 |
commit | 08605d822cdf05ee12d3f5d936ee1b4c4f46bb70 (patch) | |
tree | d733c49718aafd45ed7614531bc87b7ab1efc706 /tests/repository_test.py | |
parent | Adding upstream version 3.8.0. (diff) | |
download | pre-commit-08605d822cdf05ee12d3f5d936ee1b4c4f46bb70.tar.xz pre-commit-08605d822cdf05ee12d3f5d936ee1b4c4f46bb70.zip |
Adding upstream version 4.0.1.upstream/4.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/repository_test.py')
-rw-r--r-- | tests/repository_test.py | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/tests/repository_test.py b/tests/repository_test.py index ac065ec..b54c910 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -80,24 +80,6 @@ def _test_hook_repo( assert out == expected -def test_python_venv_deprecation(store, caplog): - config = { - 'repo': 'local', - 'hooks': [{ - 'id': 'example', - 'name': 'example', - 'language': 'python_venv', - 'entry': 'echo hi', - }], - } - _get_hook(config, store, 'example') - assert caplog.messages[-1] == ( - '`repo: local` uses deprecated `language: python_venv`. ' - 'This is an alias for `language: python`. ' - 'Often `pre-commit autoupdate --repo local` will fix this.' - ) - - def test_system_hook_with_spaces(tempdir_factory, store): _test_hook_repo( tempdir_factory, store, 'system_hook_with_spaces_repo', @@ -240,16 +222,16 @@ def test_unknown_keys(store, caplog): assert msg == 'Unexpected key(s) present on local => too-much: foo, hello' -def test_reinstall(tempdir_factory, store, log_info_mock): +def test_reinstall(tempdir_factory, store, caplog): path = make_repo(tempdir_factory, 'python_hooks_repo') config = make_config_from_repo(path) _get_hook(config, store, 'foo') # We print some logging during clone (1) + install (3) - assert log_info_mock.call_count == 4 - log_info_mock.reset_mock() + assert len(caplog.record_tuples) == 4 + caplog.clear() # Reinstall on another run should not trigger another install _get_hook(config, store, 'foo') - assert log_info_mock.call_count == 0 + assert len(caplog.record_tuples) == 0 def test_control_c_control_c_on_install(tempdir_factory, store): |