mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Show DeprecationWarning, etc. in runtests
Install default warnings filter in test runs, to avoid python's default suppression of DeprecationWarning and other "intended for developer" warnings. (Avoids need to provide -Wd or -Wall arg to runtests.)
This commit is contained in:
@@ -35,4 +35,4 @@ install:
|
|||||||
- pip install $DJANGO
|
- pip install $DJANGO
|
||||||
- pip install .
|
- pip install .
|
||||||
- pip list
|
- pip list
|
||||||
script: python -Wall setup.py test
|
script: python setup.py test
|
||||||
|
|||||||
@@ -66,17 +66,18 @@ To run the tests, either:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ python -Wall setup.py test
|
$ python setup.py test
|
||||||
|
|
||||||
or:
|
or:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ python -Wall runtests.py
|
$ python runtests.py
|
||||||
|
|
||||||
Anymail also includes some integration tests, which do call the live ESP APIs.
|
Anymail also includes some integration tests, which do call the live ESP APIs.
|
||||||
These integration tests require API keys (and sometimes other settings) they
|
These integration tests require API keys (and sometimes other settings) they
|
||||||
get from from environment variables. Look in the ``*_integration_tests.py``
|
get from from environment variables. They're skipped if these keys aren't present.
|
||||||
|
If you want to run them, look in the ``*_integration_tests.py``
|
||||||
files in the `tests source`_ for specific requirements.
|
files in the `tests source`_ for specific requirements.
|
||||||
|
|
||||||
.. _.travis.yml: https://github.com/anymail/django-anymail/blob/master/.travis.yml
|
.. _.travis.yml: https://github.com/anymail/django-anymail/blob/master/.travis.yml
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
# python runtests.py [anymail.tests.test_x anymail.tests.test_y.SomeTestCase ...]
|
# python runtests.py [anymail.tests.test_x anymail.tests.test_y.SomeTestCase ...]
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
from django import setup
|
from django import setup
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test.runner import DiscoverRunner as TestRunner
|
from django.test.runner import DiscoverRunner as TestRunner
|
||||||
|
|
||||||
|
warnings.simplefilter('default') # show DeprecationWarning and other default-ignored warnings
|
||||||
|
|
||||||
APP = 'anymail'
|
APP = 'anymail'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user