Enable pycodestyle warnings (W) and --fix incorrectly escaped strings.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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)'"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user