Skip to content

Commit 565cd05

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 7664662 commit 565cd05

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/werkzeug/routing/rules.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def _parse_rule(self, rule: str) -> t.Iterable[RulePart]:
653653
weight = Weighting(
654654
-len(static_weights),
655655
static_weights,
656-
float('+inf') if haspath else len(argument_weights),
656+
float("+inf") if haspath else len(argument_weights),
657657
argument_weights,
658658
)
659659
yield RulePart(
@@ -683,7 +683,7 @@ def _parse_rule(self, rule: str) -> t.Iterable[RulePart]:
683683
weight = Weighting(
684684
-len(static_weights),
685685
static_weights,
686-
float('+inf') if haspath else len(argument_weights),
686+
float("+inf") if haspath else len(argument_weights),
687687
argument_weights,
688688
)
689689
yield RulePart(

tests/test_routing.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def test_greedy():
382382
r.Rule("/foo", endpoint="foo"),
383383
r.Rule("/<path:bar>", endpoint="bar"),
384384
r.Rule("/<path:bar>/<blub>", endpoint="bar"),
385-
r.Rule("/<baz>/static", endpoint="oops")
385+
r.Rule("/<baz>/static", endpoint="oops"),
386386
]
387387
)
388388
adapter = map.bind("example.org", "/")
@@ -431,8 +431,11 @@ def test_static_priority():
431431

432432
adapter = map.bind("example.org", "/")
433433

434-
assert adapter.match("/d2/d1", method="GET") == ('file', {'dyn2': 'd2', 'dyn1': 'd1'})
435-
assert adapter.match("/d1/statn", method="GET") == ('stat', {'dyn1': 'd1'})
434+
assert adapter.match("/d2/d1", method="GET") == (
435+
"file",
436+
{"dyn2": "d2", "dyn1": "d1"},
437+
)
438+
assert adapter.match("/d1/statn", method="GET") == ("stat", {"dyn1": "d1"})
436439

437440

438441
def test_path():

0 commit comments

Comments
 (0)