Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prefer unittest.mock from the standard library for Python >=3.8 #793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion tests/unit/http/test_async_http_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import aiounittest

from aiohttp import ClientSession
from mock import patch, AsyncMock
try:
from unittest.mock import patch, AsyncMock
except ImportError:
# Python 3.7
from mock import patch, AsyncMock
from twilio.http.async_http_client import AsyncTwilioHttpClient


Expand Down
6 changes: 5 additions & 1 deletion tests/unit/http/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import unittest
from collections import OrderedDict

from mock import Mock, patch
try:
from unittest.mock import Mock, patch
except ImportError:
# Python 3.7
from mock import Mock, patch
from requests import Session

from twilio.base.exceptions import TwilioRestException
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/http/test_validation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import unittest

from mock import patch, Mock
try:
from unittest.mock import patch, Mock
except ImportError:
# Python 3.7
from mock import patch, Mock
from requests import Request
from requests import Session

Expand Down
6 changes: 5 additions & 1 deletion tests/unit/jwt/test_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
import unittest

import jwt as jwt_lib
from mock import patch
try:
from unittest.mock import patch
except ImportError:
# Python 3.7
from mock import patch

from twilio.jwt import Jwt, JwtDecodeError

Expand Down
6 changes: 5 additions & 1 deletion tests/unit/rest/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import unittest
import aiounittest

from mock import AsyncMock, Mock
try:
from unittest.mock import AsyncMock, Mock
except ImportError:
# Python 3.7
from mock import AsyncMock, Mock
from twilio.http.response import Response
from twilio.rest import Client

Expand Down
Loading