From eb6b41addd593ca8a332d1c5c4b1a63631d442d4 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:32:19 +0300 Subject: [PATCH] fix: use raw strings when backslashes --- mypy.ini | 0 tests/basic/test_editblock.py | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index 61d3c8668d0..037333b5922 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -18,7 +18,7 @@ def setUp(self): def test_find_filename(self): fence = ("```", "```") - valid_fnames = ["file1.py", "file2.py", "dir/file3.py", "\windows\__init__.py"] + valid_fnames = ["file1.py", "file2.py", "dir/file3.py", r"\windows\__init__.py"] # Test with filename on a single line lines = ["file1.py", "```"] @@ -45,8 +45,8 @@ def test_find_filename(self): self.assertEqual(eb.find_filename(lines, fence, valid_fnames), "file1.py") # Test with fuzzy matching - lines = ["\windows__init__.py", "```"] - self.assertEqual(eb.find_filename(lines, fence, valid_fnames), "\windows\__init__.py") + lines = [r"\windows__init__.py", "```"] + self.assertEqual(eb.find_filename(lines, fence, valid_fnames), r"\windows\__init__.py") # fuzzy logic disabled v0.11.2-dev def __test_replace_most_similar_chunk(self):