Skip to content

Commit d4f6ffb

Browse files
committed
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.)
1 parent c60790f commit d4f6ffb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ install:
3535
- pip install $DJANGO
3636
- pip install .
3737
- pip list
38-
script: python -Wall setup.py test
38+
script: python setup.py test

docs/contributing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,18 @@ To run the tests, either:
6666

6767
.. code-block:: console
6868
69-
$ python -Wall setup.py test
69+
$ python setup.py test
7070
7171
or:
7272

7373
.. code-block:: console
7474
75-
$ python -Wall runtests.py
75+
$ python runtests.py
7676
7777
Anymail also includes some integration tests, which do call the live ESP APIs.
7878
These integration tests require API keys (and sometimes other settings) they
79-
get from from environment variables. Look in the ``*_integration_tests.py``
79+
get from from environment variables. They're skipped if these keys aren't present.
80+
If you want to run them, look in the ``*_integration_tests.py``
8081
files in the `tests source`_ for specific requirements.
8182

8283
.. _.travis.yml: https://github.com/anymail/django-anymail/blob/master/.travis.yml

runtests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# python runtests.py [anymail.tests.test_x anymail.tests.test_y.SomeTestCase ...]
44

55
import sys
6+
import warnings
67

78
from django import setup
89
from django.conf import settings
910
from django.test.runner import DiscoverRunner as TestRunner
1011

12+
warnings.simplefilter('default') # show DeprecationWarning and other default-ignored warnings
1113

1214
APP = 'anymail'
1315

0 commit comments

Comments
 (0)