Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Sphinx>=1.8.0
mock
pytest
pytest-cov
aiounittest
flake8
wheel>=0.22.0
cryptography
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/base/test_version.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/http/test_async_http_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aiounittest
import unittest

from aiohttp import ClientSession
from mock import patch, AsyncMock
Expand All @@ -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)
Expand Down Expand Up @@ -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 = [
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/rest/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import unittest

import aiounittest

from mock import AsyncMock, Mock

from twilio.http.response import Response
Expand Down Expand Up @@ -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")
Expand Down
Loading