Skip to content

Commit 85b2635

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 26baab7 commit 85b2635

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/test_integration_autodoc_type_aliases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_integration(
151151
if regexp:
152152
msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {value!r}"
153153
assert re.search(regexp, value), msg
154-
elif not re.search("WARNING: Inline strong start-string without end-string.", value):
154+
elif not re.search(r"WARNING: Inline strong start-string without end-string.", value):
155155
assert not value
156156

157157
result = (Path(app.srcdir) / "_build/text/index.txt").read_text()

tests/test_sphinx_autodoc_typehints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def test_format_annotation(inv: Inventory, annotation: Any, expected_result: str
491491

492492
# Test for the correct role (class vs data) using the official Sphinx inventory
493493
if "typing" in expected_result:
494-
m = re.match("^:py:(?P<role>class|data|func):`~(?P<name>[^`]+)`", result)
494+
m = re.match(r"^:py:(?P<role>class|data|func):`~(?P<name>[^`]+)`", result)
495495
assert m, "No match"
496496
name = m.group("name")
497497
expected_role = next((o.role for o in inv.objects if o.name == name), None)
@@ -905,7 +905,7 @@ def test_resolve_typing_guard_imports(app: SphinxTestApp, status: StringIO, warn
905905
out = status.getvalue()
906906
assert "build succeeded" in out
907907
err = warning.getvalue()
908-
r = re.compile("WARNING: Failed guarded type import")
908+
r = re.compile(r"WARNING: Failed guarded type import")
909909
assert len(r.findall(err)) == 1
910910
pat = r'WARNING: Failed guarded type import with ImportError\("cannot import name \'missing\' from \'functools\''
911911
assert re.search(pat, err)

0 commit comments

Comments
 (0)