diff --git a/aiovk/drivers.py b/aiovk/drivers.py index 8860d4a..b8edaa8 100644 --- a/aiovk/drivers.py +++ b/aiovk/drivers.py @@ -61,7 +61,7 @@ async def post_text(self, url, data, timeout=None): ''' raise NotImplementedError - def close(self): + async def close(self): raise NotImplementedError @@ -91,8 +91,8 @@ async def post_text(self, url, data, timeout=None): async with self.session.post(url, data=data, timeout=timeout or self.timeout) as response: return response.url, await response.text() - def close(self): - self.session.close() + async def close(self): + await self.session.close() if ProxyConnector is not None: diff --git a/aiovk/mixins.py b/aiovk/mixins.py index c2cbd1c..2952590 100644 --- a/aiovk/mixins.py +++ b/aiovk/mixins.py @@ -25,8 +25,8 @@ async def get_bin(self, *args, **kwargs): async def post_text(self, *args, **kwargs): return await super().post_text(*args, **kwargs) - def close(self): - super().close() + async def close(self): + await super().close() self._queue.canel() diff --git a/aiovk/sessions.py b/aiovk/sessions.py index 969baf2..fa6984d 100644 --- a/aiovk/sessions.py +++ b/aiovk/sessions.py @@ -18,9 +18,9 @@ async def __aenter__(self): async def __aexit__(self, exc_type, exc_val, exc_tb): """Closes session after usage of context manager with Session""" - self.close() + await self.close() - def close(self) -> None: + async def close(self) -> None: """Perform the actions associated with the completion of the current session""" @abstractmethod diff --git a/requirements-dev.txt b/requirements-dev.txt index b4c3a64..4ca757e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -r requirements.txt aio.testing==0.1.0 -aiounittest-1.1.0 +aiounittest==1.1.0 pyotp==2.2.6