summaryrefslogtreecommitdiffstats
path: root/tests/commands/autoupdate_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-27 16:04:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-27 16:04:26 +0000
commit7ad3acc8faa151e307c82b659f884205ef47012b (patch)
treeda74df356ea350b3ee9fb0bf71937e0bdb7896a6 /tests/commands/autoupdate_test.py
parentReleasing debian version 2.8.2-1. (diff)
downloadpre-commit-7ad3acc8faa151e307c82b659f884205ef47012b.tar.xz
pre-commit-7ad3acc8faa151e307c82b659f884205ef47012b.zip
Merging upstream version 2.9.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/commands/autoupdate_test.py')
-rw-r--r--tests/commands/autoupdate_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/commands/autoupdate_test.py b/tests/commands/autoupdate_test.py
index bd89c1d..b2bad60 100644
--- a/tests/commands/autoupdate_test.py
+++ b/tests/commands/autoupdate_test.py
@@ -1,9 +1,12 @@
import shlex
+from unittest import mock
import pytest
+import yaml
import pre_commit.constants as C
from pre_commit import git
+from pre_commit import util
from pre_commit.commands.autoupdate import _check_hooks_still_exist_at_rev
from pre_commit.commands.autoupdate import autoupdate
from pre_commit.commands.autoupdate import RepositoryCannotBeUpdatedError
@@ -173,6 +176,11 @@ def test_autoupdate_out_of_date_repo(out_of_date, tmpdir, store):
assert cfg.read() == fmt.format(out_of_date.path, out_of_date.head_rev)
+def test_autoupdate_pure_yaml(out_of_date, tmpdir, store):
+ with mock.patch.object(util, 'Dumper', yaml.SafeDumper):
+ test_autoupdate_out_of_date_repo(out_of_date, tmpdir, store)
+
+
def test_autoupdate_only_one_to_update(up_to_date, out_of_date, tmpdir, store):
fmt = (
'repos:\n'