Skip to content

Commit adc92f0

Browse files
authored
Tests: tox and mock cleanup
* Remove mock dependency (mock is now part of standard unittest package) * Cleanup tox dependency installation logic
1 parent e90c10b commit adc92f0

24 files changed

+32
-27
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ def long_description_from_readme(rst):
3030
long_description = long_description_from_readme(f.read())
3131

3232

33+
# Additional requirements for development/build/release
3334
requirements_dev = [
3435
"flake8",
3536
"sphinx",
3637
"sphinx-rtd-theme",
3738
"tox",
3839
"twine",
40+
"wheel",
3941
]
4042

41-
requirements_test = ["mock", "boto3", "cryptography"]
43+
# Additional requirements for running tests
44+
requirements_test = []
4245

4346

4447
setup(

tests/mock_requests_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
22
from io import BytesIO
3+
from unittest.mock import patch
34

45
from django.core import mail
56
from django.test import SimpleTestCase
67
import requests
7-
from mock import patch
88

99
from anymail.exceptions import AnymailAPIError
1010

tests/test_amazon_ses_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import json
22
from datetime import datetime
33
from email.mime.application import MIMEApplication
4+
from unittest.mock import ANY, patch
45

56
from django.core import mail
67
from django.core.mail import BadHeaderError
78
from django.test import SimpleTestCase, override_settings, tag
8-
from mock import ANY, patch
99

1010
from anymail.exceptions import AnymailAPIError, AnymailUnsupportedFeature
1111
from anymail.inbound import AnymailInboundMessage

tests/test_amazon_ses_inbound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from base64 import b64encode
33
from datetime import datetime
44
from textwrap import dedent
5+
from unittest.mock import ANY, patch
56

67
from django.test import tag
78
from django.utils.timezone import utc
8-
from mock import ANY, patch
99

1010
from anymail.exceptions import AnymailAPIError, AnymailConfigurationError
1111
from anymail.inbound import AnymailInboundMessage

tests/test_amazon_ses_webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
22
import warnings
33
from datetime import datetime
4+
from unittest.mock import ANY, patch
45

56
from django.test import SimpleTestCase, override_settings, tag
67
from django.utils.timezone import utc
7-
from mock import ANY, patch
88

99
from anymail.exceptions import AnymailConfigurationError, AnymailInsecureWebhookWarning
1010
from anymail.signals import AnymailTrackingEvent

tests/test_mailgun_inbound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from datetime import datetime
33
from io import BytesIO
44
from textwrap import dedent
5+
from unittest.mock import ANY
56

67
from django.test import override_settings, tag
78
from django.utils.timezone import utc
8-
from mock import ANY
99

1010
from anymail.exceptions import AnymailConfigurationError
1111
from anymail.inbound import AnymailInboundMessage

tests/test_mailgun_webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import json
22
from datetime import datetime
3+
from unittest.mock import ANY
34

45
import hashlib
56
import hmac
67
from django.core.exceptions import ImproperlyConfigured
78
from django.test import override_settings, tag
89
from django.utils.timezone import utc
9-
from mock import ANY
1010

1111
from anymail.exceptions import AnymailConfigurationError
1212
from anymail.signals import AnymailTrackingEvent

tests/test_mailjet_inbound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
22
from base64 import b64encode
3+
from unittest.mock import ANY
34

45
from django.test import tag
5-
from mock import ANY
66

77
from anymail.inbound import AnymailInboundMessage
88
from anymail.signals import AnymailInboundEvent

tests/test_mailjet_webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import json
22
from datetime import datetime
3+
from unittest.mock import ANY
34

45
from django.test import tag
56
from django.utils.timezone import utc
6-
from mock import ANY
77

88
from anymail.signals import AnymailTrackingEvent
99
from anymail.webhooks.mailjet import MailjetTrackingWebhookView

tests/test_mandrill_inbound.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from textwrap import dedent
2+
from unittest.mock import ANY
23

34
from django.test import override_settings, tag
4-
from mock import ANY
55

66
from anymail.inbound import AnymailInboundMessage
77
from anymail.signals import AnymailInboundEvent

0 commit comments

Comments
 (0)