Added support for coverage and tox

master
androiddrew 7 years ago
parent e05e60eb8a
commit 665835e9a7

@ -0,0 +1,3 @@
[run]
source = apistar_mail
omit = test*

@ -83,4 +83,18 @@ A Message can contain a body and/or HTML:
``` ```
msg.body = 'message body' msg.body = 'message body'
msg.html = '<b>Hello apistar_mail!</b>' msg.html = '<b>Hello apistar_mail!</b>'
``` ```
## Testing
To run the test suite with coverage first install the package in editable mode with it's testing requirements:
`pip install -e ".[testing]"`
To run the project's tests
`pytest --cov`
To run tests against multiple python interpreters use:
`tox`

@ -10,13 +10,10 @@ requirements = [
'apistar', 'apistar',
] ]
setup_requirements = [
'pytest-runner',
]
test_requirements = [ test_requirements = [
'pytest', 'pytest',
'coverage', 'pytest-cov',
'tox'
] ]
setup( setup(
@ -38,11 +35,10 @@ setup(
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License', 'License :: OSI Approved :: MIT License',
'Natural Language :: English', 'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
], ],
test_suite='tests', extras_require={
tests_require=test_requirements, 'testing': test_requirements,
setup_requires=setup_requirements, }
) )

@ -1,10 +1,10 @@
from apistar_mail.mail import Message, Mailer, force_text from apistar_mail.mail import Message, Mail, force_text
from apistar_mail.exc import MailUnicodeDecodeError from apistar_mail.exc import MailUnicodeDecodeError
import pytest import pytest
settings = { settings = {
'EMAIL': { 'MAIL': {
'MAIL_SERVER': 'smtp.example.com', 'MAIL_SERVER': 'smtp.example.com',
'MAIL_USERNAME': 'fake@example.com', 'MAIL_USERNAME': 'fake@example.com',
'MAIL_PASSWORD': 'secret', 'MAIL_PASSWORD': 'secret',

@ -0,0 +1,5 @@
[tox]
envlist = py35,py36
[testenv]
deps=pytest
commands=pytest
Loading…
Cancel
Save