Enable pycodestyle warnings (W) and --fix incorrectly escaped strings.

This commit is contained in:
L. Kärkkäinen
2023-10-25 02:06:06 +01:00
parent ec35f5f2c8
commit 9adb6e8ec0
3 changed files with 6 additions and 6 deletions

View File

@@ -2211,7 +2211,7 @@ async def test_conflicting_body_methods_overload_error(app: Sanic):
with pytest.raises(
ServerError,
match="Duplicate route names detected: test_conflicting_body_methods_overload_error\.put.*",
match=r"Duplicate route names detected: test_conflicting_body_methods_overload_error\.put.*",
):
await app._startup()
@@ -2273,7 +2273,7 @@ async def test_handler_overload_error(app: Sanic):
with pytest.raises(
ServerError,
match="Duplicate route names detected: test_handler_overload_error\.handler.*",
match=r"Duplicate route names detected: test_handler_overload_error\.handler.*",
):
await app._startup()

View File

@@ -1129,7 +1129,7 @@ def test_route_invalid_host(app):
def test_route_with_regex_group(app):
@app.route("/path/to/<ext:file\.(txt)>")
@app.route(r"/path/to/<ext:file\.(txt)>")
async def handler(request, ext):
return text(ext)
@@ -1160,7 +1160,7 @@ def test_route_with_regex_named_group_invalid(app):
def test_route_with_regex_group_ambiguous(app):
@app.route("/path/to/<ext:file(?:\.)(txt)>")
@app.route(r"/path/to/<ext:file(?:\.)(txt)>")
async def handler(request, ext):
return text(ext)
@@ -1169,7 +1169,7 @@ def test_route_with_regex_group_ambiguous(app):
assert e.match(
re.escape(
"Could not compile pattern file(?:\.)(txt). Try using a named "
r"Could not compile pattern file(?:\.)(txt). Try using a named "
"group instead: '(?P<ext>your_matching_group)'"
)
)