Skip to content

Commit af99bac

Browse files
committed
Fix unittests for patterns
1 parent 7196d0e commit af99bac

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

httpx/_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ def priority(self) -> tuple[int, int, int]:
240240
scheme_priority = -len(self.scheme)
241241
return (port_priority, host_priority, scheme_priority)
242242

243+
def __repr__(self) -> str:
244+
return f"{self.pattern}"
245+
243246
def __hash__(self) -> int:
244247
return hash(self.pattern)
245248

@@ -271,6 +274,9 @@ def matches(self, other: URL) -> bool:
271274
def priority(self) -> tuple[int, int, int]:
272275
return -1, 0, 0 # higher priority than URLPatterns
273276

277+
def __repr__(self) -> str:
278+
return f"{self.net}"
279+
274280
def __hash__(self) -> int:
275281
return hash(self.net)
276282

0 commit comments

Comments
 (0)