diff --git a/reqtools/sessions.py b/reqtools/sessions.py index a9e43a4..d78521b 100644 --- a/reqtools/sessions.py +++ b/reqtools/sessions.py @@ -18,9 +18,8 @@ def __init__(self, base_url: str, *, prefix: str = None, request_timeout: int = self._base_url = base_url self._prefix = prefix - self._reqest_timeout = 5 if request_timeout: - self._reqest_timeout = request_timeout + self._request_timeout = request_timeout def __repr__(self): return f'{self.__class__.__name__}({self.url})' @@ -38,7 +37,8 @@ def url(self): return self._build_url(self._base_url, self._prefix) def request(self, method: str, url_path: str, **kwargs): - kwargs.setdefault('timeout', self._reqest_timeout) + if self._request_timeout: + kwargs.setdefault('timeout', self._request_timeout) url = self._build_url(self.url, url_path)