summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-16 11:18:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-16 11:18:17 +0000
commit4665bcab6116fe63b2b1111d1a0bc9842cef47a5 (patch)
treefcf65faa149757e9b294c309565938eb3c6dac59 /tests
parentReleasing debian version 4.4.0+dfsg-1. (diff)
downloadpre-commit-hooks-4665bcab6116fe63b2b1111d1a0bc9842cef47a5.tar.xz
pre-commit-hooks-4665bcab6116fe63b2b1111d1a0bc9842cef47a5.zip
Merging upstream version 4.5.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/file_contents_sorter_test.py4
-rw-r--r--tests/string_fixer_test.py6
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/file_contents_sorter_test.py b/tests/file_contents_sorter_test.py
index 5e79e40..49b3b79 100644
--- a/tests/file_contents_sorter_test.py
+++ b/tests/file_contents_sorter_test.py
@@ -10,7 +10,9 @@ from pre_commit_hooks.file_contents_sorter import PASS
@pytest.mark.parametrize(
('input_s', 'argv', 'expected_retval', 'output'),
(
- (b'', [], FAIL, b'\n'),
+ (b'', [], PASS, b''),
+ (b'\n', [], FAIL, b''),
+ (b'\n\n', [], FAIL, b''),
(b'lonesome\n', [], PASS, b'lonesome\n'),
(b'missing_newline', [], FAIL, b'missing_newline\n'),
(b'newline\nmissing', [], FAIL, b'missing\nnewline\n'),
diff --git a/tests/string_fixer_test.py b/tests/string_fixer_test.py
index 9dd7315..8eb164c 100644
--- a/tests/string_fixer_test.py
+++ b/tests/string_fixer_test.py
@@ -37,6 +37,12 @@ TESTS = (
1,
),
('"foo""bar"', "'foo''bar'", 1),
+ pytest.param(
+ "f'hello{\"world\"}'",
+ "f'hello{\"world\"}'",
+ 0,
+ id='ignore nested fstrings',
+ ),
)