Skip to content
Snippets Groups Projects
Commit aa4c18f8 authored by Alexandre Detiste's avatar Alexandre Detiste
Browse files

depends on new python3-aiounittest, drop patch

parent da0dc747
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ Build-Depends:
dh-sequence-python3,
python3-aiohttp,
python3-aiohttp-retry,
python3-aiounittest,
python3-all:any,
python3-cryptography,
python3-django,
......
use-isolated-asyncio-testcase.patch
Description: use native IsolatedAsyncioTestCase instead of missing aiounittest
Forwarded: https://github.com/twilio/twilio-python/pull/752
Author: Jérémy Lal <kapouer@melix.org>
--- a/tests/unit/http/test_async_http_client.py
+++ b/tests/unit/http/test_async_http_client.py
@@ -1,5 +1,4 @@
-import aiounittest
-
+import unittest
from aiohttp import ClientSession
from mock import patch, AsyncMock
from twilio.http.async_http_client import AsyncTwilioHttpClient
@@ -19,7 +18,7 @@
return self._text
-class TestAsyncHttpClientRequest(aiounittest.AsyncTestCase):
+class TestAsyncHttpClientRequest(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.session_mock = AsyncMock(wraps=ClientSession)
self.session_mock.request.return_value = MockResponse("test", 200)
@@ -58,7 +57,7 @@
await self.client.request("doesnt matter", "doesnt matter", timeout=-1)
-class TestAsyncHttpClientRetries(aiounittest.AsyncTestCase):
+class TestAsyncHttpClientRetries(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.session_mock = AsyncMock(wraps=ClientSession)
self.session_mock.request.side_effect = [
@@ -91,7 +90,7 @@
self.assertEqual(response.text, "Error")
-class TestAsyncHttpClientSession(aiounittest.AsyncTestCase):
+class TestAsyncHttpClientSession(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.session_patcher = patch("twilio.http.async_http_client.ClientSession")
self.session_constructor_mock = self.session_patcher.start()
--- a/tests/unit/rest/test_client.py
+++ b/tests/unit/rest/test_client.py
@@ -1,5 +1,4 @@
import unittest
-import aiounittest
from mock import AsyncMock, Mock
from twilio.http.response import Response
@@ -106,7 +105,7 @@
self.assertEqual(user_agent_extensions, expected_user_agent_extensions)
-class TestClientAsyncRequest(aiounittest.AsyncTestCase):
+class TestClientAsyncRequest(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.mock_async_http_client = AsyncMock()
self.mock_async_http_client.request.return_value = Response(200, "test")
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -2,7 +2,7 @@
mock
pytest
pytest-cov
-aiounittest
+#aiounittest
flake8
wheel>=0.22.0
cryptography
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment