Enable pycodestyle warnings (W) and --fix incorrectly escaped strings.
This commit is contained in:
parent
ec35f5f2c8
commit
9adb6e8ec0
|
@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
|
|||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.ruff]
|
||||
extend-select = ["I"]
|
||||
extend-select = ["I", "W"]
|
||||
ignore = ["D100", "D101", "D102", "D103", "E402", "E741", "F811", "F821"]
|
||||
line-length = 79
|
||||
show-source = true
|
||||
|
|
|
@ -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)'"
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user