mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Tests: limit live API integration tests in Travis runs
To conserve our ESP test accounts' send quotas, don't run the live API integration tests 13 times in every Travis run. Instead, just run them twice, on a representative set of Python/Django combinations: * Once on Python 2.7 (currently with Django 1.8) * Once on Python 3.x (currently 3.5 with Django 1.9) (Prep for running weekly tests on Travis cron.) The *non*-integration tests still run on all combos. * Introduce RUN_LIVE_TESTS environment var to control whether live API integration test cases should run. Default True, except in Travis-CI runs default False. * Enable RUN_LIVE_TESTS in .travis.yml matrix for the Python/Django combos listed above.
This commit is contained in:
@@ -10,11 +10,12 @@ from django.test.utils import override_settings
|
||||
from anymail.exceptions import AnymailAPIError, AnymailRecipientsRefused
|
||||
from anymail.message import AnymailMessage
|
||||
|
||||
from .utils import AnymailTestMixin, sample_image_path
|
||||
from .utils import AnymailTestMixin, sample_image_path, RUN_LIVE_TESTS
|
||||
|
||||
MANDRILL_TEST_API_KEY = os.getenv('MANDRILL_TEST_API_KEY')
|
||||
|
||||
|
||||
@unittest.skipUnless(RUN_LIVE_TESTS, "RUN_LIVE_TESTS disabled in this environment")
|
||||
@unittest.skipUnless(MANDRILL_TEST_API_KEY,
|
||||
"Set MANDRILL_TEST_API_KEY environment variable to run integration tests")
|
||||
@override_settings(MANDRILL_API_KEY=MANDRILL_TEST_API_KEY,
|
||||
|
||||
Reference in New Issue
Block a user