Commit Graph

21 Commits

Author SHA1 Message Date
Mike Edmunds
e8df0ec8e0 Modernize packaging
Switch to pyproject.toml packaging, using hatchling.

- Replace all uses of setup.py with updated equivalent
- BREAKING: Change extra name `amazon_ses` to
  `amazon-ses`, to comply with Python packaging
  name normalization
- Use hatch custom build hook to freeze version number
  in readme (previously custom setup.py code)
- Move separate requirements for dev, docs, tests
  into their own requirements.txt files
- Fix AnymailImproperlyInstalled to correctly refer
  to package extra name
- Update testing documentation
- Update docs readme rendering to match PyPI
  (and avoid setup.py)
- In tox tests, use isolated builds and update pip
- Remove AUTHORS.txt (it just referred to GitHub)
2023-05-03 16:55:08 -07:00
medmunds
ec864f5165 Tests: simplify test_settings maintenance
If no version-specific tests.test_settings.settings* file
exists for the current Django version, fall back to an
earlier settings file.

- runtests.py find latest settings_N_M earlier than or
  matching Django version N.M being tested, rather than
  requiring exact match
- remove test_settings files that were just duplicates
  of earlier versions
2023-02-08 11:03:06 -08:00
medmunds
b4e22c63b3 Reformat code with automated tools
Apply standardized code style
2023-02-06 15:05:24 -08:00
medmunds
bb8e583f06 Tests: clean up env var handling
* Replace deprecated strtobool
* Strip whitespace from env values
2022-01-19 14:54:29 -08:00
Mike Edmunds
5cbaa24002 Move CI testing to GitHub Actions
Related changes:
* remove Travis-CI config; stop running tests on Travis
* rename live integration test environment variables
  to all start with `ANYMAIL_TEST_` (simplifies tox config)
2020-11-28 18:08:01 -08:00
Mike Edmunds
85cec5e9dc Drop Python 2 and Django 1.11 support
Minimum supported versions are now Django 2.0, Python 3.5.

This touches a lot of code, to:
* Remove obsolete portability code and workarounds
  (six, backports of email parsers, test utils, etc.)
* Use Python 3 syntax (class defs, raise ... from, etc.)
* Correct inheritance for mixin classes
* Fix outdated docs content and links
* Suppress Python 3 "unclosed SSLSocket" ResourceWarnings
  that are beyond our control (in integration tests due to boto3, 
  python-sparkpost)
2020-08-01 14:53:10 -07:00
Mike Edmunds
978996d7b8 Test without optional packages
Tox:
* Add Tox factor for extras (all, none, individual ESP).
  For now, only break out ESPs that have specific extra
  dependencies (amazon_ses, sparkpost).
* Install most package dependencies (including extras)
  through the package itself.
* Use new runtests.py environment vars to limit test tags
  when Tox isn't installing all extras.

Travis:
* Rework matrix to request specific TOXENVs directly;
  drop tox-travis.

Test runner (runtests.py):
* Centralize RUN_LIVE_TESTS logic in runtests.py
* Add ANYMAIL_ONLY_TEST and ANYMAIL_SKIP_TESTS env vars
  (comma-separated lists of tags)

Test implementations:
* Tag all ESP-specific tests with ESP
* Tag live tests with "live"
* Don't import ESP-specific packages at test module level. 
  (Test discovery imports test modules before tag-based filtering.)

Closes #104
2019-02-09 15:04:08 -08:00
medmunds
c9dfec679c Fix running tests from setup.py test_suite 2016-05-31 12:19:04 -07:00
medmunds
34af81aee6 Tests: Simplify Django version compatibility
* Restructure runtests.py as suggested in
  https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications

* Load version-specific Django settings modules
  (rather than trying to make a single settings.configure()
  work with all supported versions).

* Use `django-admin startproject` defaults for all
  settings modules. (Tests compatibility with typical
  apps, middleware, and other settings.)

* Set up tests-specific url config; switch to literal
  urls in test cases. (Eliminates url `reverse` from
  tests.)

* Make runtests.py executable

Closes #18
2016-05-31 11:57:19 -07:00
medmunds
d4f6ffbb41 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.)
2016-05-12 17:42:44 -07:00
medmunds
c7a8c81e32 Remove pre-Django 1.8 compatibility code 2016-04-30 10:33:51 -07:00
medmunds
385d76b53a Move tests out of app module
(Directory structure as suggested in
[Django testing docs][1].)

[1]: https://docs.djangoproject.com/en/1.9/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications
2016-03-21 11:38:58 -07:00
medmunds
4ad2af2469 Allow running specific test cases in runtests 2016-03-06 10:34:23 -08:00
medmunds
921dd5d0d6 Fork from Djrill and rename to "anymail" 2016-02-27 11:16:04 -08:00
medmunds
99ac099081 Remove DjrillAdminSite
Closes #78
2015-05-14 11:00:52 -07:00
medmunds
52de627af1 Clean up test warnings for Django 1.8
* Django 1.8 requires TEMPLATES setting (for admin tests)
* Ignore cycle tag deprecation warnings

One remaining PendingDeprecationWarning: "the imp module is
deprecated in favour of importlib" is coming from six, and has a fix
waiting to land: https://bitbucket.org/gutworth/six/issue/112
2015-05-11 18:09:56 -07:00
medmunds
0b4a210031 Test against SimpleAdminConfig on Django>=1.7.
In test cases, use the same admin setup we recommend to users.
2015-01-16 13:29:43 -08:00
medmunds
55dc242879 Fix tests in Django 1.7
Django 1.7 doesn't include session or auth middleware
in minimal default config. Djrill admin views require auth.
2014-07-28 08:27:55 -07:00
medmunds
1e39e4d5c8 Start testing Django 1.7b1 2014-04-20 14:45:29 -07:00
medmunds
76a90cdf04 Use django.test.runner.DiscoverRunner on Django 1.6+ 2014-04-20 13:56:20 -07:00
medmunds
1bec172611 Testing on backend API calls, using mock; add runtests.py.
Cherry-picked from:
8c26807a - Add runtests.py for testing separately from other Django apps
cd8504b1 - Make tests compatible with setuptools
4ac65b78 - Set up testing on the backend API calls, using mock
2012-10-31 18:15:54 -07:00