diff --git a/tests/requirements.txt b/tests/requirements.txt index 679f8e13d..a6224c982 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,7 +2,6 @@ Sphinx>=1.8.0 mock pytest pytest-cov -aiounittest flake8 wheel>=0.22.0 cryptography diff --git a/tests/unit/base/test_version.py b/tests/unit/base/test_version.py index 94c0ad496..85b9fdd16 100644 --- a/tests/unit/base/test_version.py +++ b/tests/unit/base/test_version.py @@ -1,7 +1,6 @@ import unittest from unittest.mock import Mock -import aiounittest from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.version import Version @@ -791,7 +790,7 @@ def test_fetch_with_response_info_returns_tuple(self): self.assertIsInstance(headers, dict) -class AsyncVersionTestCase(aiounittest.AsyncTestCase): +class AsyncVersionTestCase(unittest.IsolatedAsyncioTestCase): def setUp(self): from tests.holodeck import AsyncHolodeck from twilio.rest import Client diff --git a/tests/unit/http/test_async_http_client.py b/tests/unit/http/test_async_http_client.py index 23df35dc0..bbb89eda0 100644 --- a/tests/unit/http/test_async_http_client.py +++ b/tests/unit/http/test_async_http_client.py @@ -1,4 +1,4 @@ -import aiounittest +import unittest from aiohttp import ClientSession from mock import patch, AsyncMock @@ -20,7 +20,7 @@ async def text(self): 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) @@ -59,7 +59,7 @@ async def test_invalid_request_timeout_raises_exception(self): 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 = [ @@ -92,7 +92,7 @@ async def test_request_retries_until_max(self): 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() diff --git a/tests/unit/rest/test_client.py b/tests/unit/rest/test_client.py index f2e2affc0..6053120f7 100644 --- a/tests/unit/rest/test_client.py +++ b/tests/unit/rest/test_client.py @@ -1,7 +1,5 @@ import unittest -import aiounittest - from mock import AsyncMock, Mock from twilio.http.response import Response @@ -108,7 +106,7 @@ def test_set_user_agent_extensions(self): 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")