Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
source = mailer | ||
omit = mailer/tests.py | ||
branch = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
language: python | ||
|
||
python: | ||
- 2.7 | ||
|
||
env: | ||
- DJANGO=https://github.com/django/django/tarball/master | ||
- DJANGO=Django==1.6.5 | ||
install: | ||
- pip install flake8 | ||
- pip install -e . | ||
|
||
script: | ||
- pip install flake8 coverage coveralls $DJANGO | ||
before_script: | ||
- flake8 --max-line-length=100 --max-complexity=10 --statistics --benchmark mailer | ||
script: | ||
- coverage run runtests.py | ||
after_script: | ||
- coveralls |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
import django | ||
|
||
from django.conf import settings | ||
|
||
|
||
DEFAULT_SETTINGS = dict( | ||
INSTALLED_APPS=[ | ||
"django.contrib.auth", | ||
"django.contrib.contenttypes", | ||
"django.contrib.sites", | ||
"mailer", | ||
], | ||
DATABASES={ | ||
"default": { | ||
"ENGINE": "django.db.backends.sqlite3", | ||
"NAME": ":memory:", | ||
} | ||
}, | ||
SITE_ID=1, | ||
SECRET_KEY="notasecret", | ||
) | ||
|
||
|
||
def runtests(*test_args): | ||
if not settings.configured: | ||
settings.configure(**DEFAULT_SETTINGS) | ||
|
||
# Compatibility with Django 1.7's stricter initialization | ||
if hasattr(django, "setup"): | ||
django.setup() | ||
|
||
parent = os.path.dirname(os.path.abspath(__file__)) | ||
sys.path.insert(0, parent) | ||
|
||
try: | ||
from django.test.runner import DiscoverRunner | ||
runner_class = DiscoverRunner | ||
test_args = ["mailer.tests"] | ||
except ImportError: | ||
from django.test.simple import DjangoTestSuiteRunner | ||
runner_class = DjangoTestSuiteRunner | ||
test_args = ["tests"] | ||
|
||
failures = runner_class( | ||
verbosity=1, interactive=True, failfast=False).run_tests(test_args) | ||
sys.exit(failures) | ||
|
||
|
||
if __name__ == "__main__": | ||
runtests(*sys.argv[1:]) |