From 7799241900fe8e3cb0832b99e17fa9cd9b4144b4 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 6 Jan 2015 23:27:00 +0100 Subject: [PATCH] Use py.test. Signed-off-by: Jannis Leidel --- MANIFEST.in | 1 - manage.py | 11 ----------- setup.cfg | 9 +++++++++ tests/settings/main.py | 3 --- tox.ini | 18 +++++++----------- 5 files changed, 16 insertions(+), 26 deletions(-) delete mode 100755 manage.py diff --git a/MANIFEST.in b/MANIFEST.in index caa1d1a..3cf031f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,6 @@ include README.rst include AUTHORS include .travis.yml -include manage.py include tasks.py recursive-include tests * recursive-include docs * diff --git a/manage.py b/manage.py deleted file mode 100755 index 3dd6dcb..0000000 --- a/manage.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings.main') - os.environ.setdefault('DJANGO_CONFIGURATION', 'Test') - - from configurations.management import execute_from_command_line - - execute_from_command_line(sys.argv) diff --git a/setup.cfg b/setup.cfg index 5e40900..68af234 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,11 @@ +[pytest] +django_find_project = false +addopts = --cov configurations +DJANGO_SETTINGS_MODULE = tests.settings.main +DJANGO_CONFIGURATION = Test + [wheel] universal = 1 + +[flake8] +ignore = E124,E501,E127,E128 diff --git a/tests/settings/main.py b/tests/settings/main.py index d646271..c0bb716 100644 --- a/tests/settings/main.py +++ b/tests/settings/main.py @@ -34,9 +34,6 @@ class Test(Configuration): ROOT_URLCONF = 'tests.urls' - if django.VERSION[:2] < (1, 6): - TEST_RUNNER = 'discover_runner.DiscoverRunner' - def TEMPLATE_CONTEXT_PROCESSORS(self): return Configuration.TEMPLATE_CONTEXT_PROCESSORS + ( 'tests.settings.base.test_callback', diff --git a/tox.ini b/tox.ini index 4826948..1be78c7 100644 --- a/tox.ini +++ b/tox.ini @@ -20,31 +20,27 @@ basepython = pypy: pypy usedevelop = true deps = - django-discover-runner mock dj-database-url dj-email-url dj-search-url django-cache-url>=0.6.0 six + pytest-django + pytest-cov dj14: https://github.com/django/django/archive/stable/1.4.x.zip#egg=django dj15: https://github.com/django/django/archive/stable/1.5.x.zip#egg=django dj16: https://github.com/django/django/archive/stable/1.6.x.zip#egg=django dj17: https://github.com/django/django/archive/stable/1.7.x.zip#egg=django dj18: https://github.com/django/django/archive/master.zip#egg=django - flake8: flake8 - coverage: coverage commands = - python manage.py test -v2 {posargs:tests} + py.test {posargs:} [testenv:flake8-py27] -commands = flake8 configurations --ignore=E501,E127,E128,E124 +commands = flake8 configurations +deps = flake8 [testenv:flake8-py33] -commands = flake8 configurations --ignore=E501,E127,E128,E124 - -[testenv:coverage-py27-dj16] -commands = coverage erase - coverage run manage.py test -v2 {posargs:tests} - coverage report +commands = flake8 configurations +deps = flake8