Skip to content

Commit 3854a2f

Browse files
committed
Avoid ty error on method name
1 parent 0df3241 commit 3854a2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mock_vws/_requests_mock_server/mock_web_query_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import email.utils
88
from collections.abc import Callable, Iterable, Mapping
99
from http import HTTPMethod, HTTPStatus
10+
from types import MethodType
1011

1112
from beartype import beartype
1213
from requests.models import PreparedRequest
@@ -52,8 +53,9 @@ def decorator(
5253
The given `method` with multiple changes, including added
5354
validators.
5455
"""
56+
route_name = method.__name__ if isinstance(method, MethodType) else ""
5557
new_route = Route(
56-
route_name=method.__name__,
58+
route_name=route_name,
5759
path_pattern=path_pattern,
5860
http_methods=frozenset(http_methods),
5961
)

0 commit comments

Comments
 (0)