Skip to content

Commit

Permalink
Merge pull request #266 from django-nose/django_1_10
Browse files Browse the repository at this point in the history
Release 1.4.4, Add Django 1.10 support
  • Loading branch information
jwhitlock authored Jun 27, 2016
2 parents 9ecfc4d + d08492e commit 9403382
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 111 deletions.
64 changes: 46 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,57 @@ language: python
env:
global:
- COVERAGE=1 RUNTEST_ARGS="-v --noinput"
matrix:
matrix:
include:
# Quality checks
- TOXENV=flake8
- TOXENV=docs
- env: TOXENV=flake8
python: "2.7"
- env: TOXENV=docs
python: "2.7"
# Supported Python / Django versions w/ SQLite
- TOXENV=py27-django-19
- TOXENV=py35-django-19
- TOXENV=py27-django-18
- TOXENV=py34-django-18
- env: TOXENV=py27-django-110
python: "2.7"
- env: TOXENV=py35-django-110
python: "3.5"
- env: TOXENV=py27-django-19
python: "2.7"
- env: TOXENV=py35-django-19
python: "3.5"
- env: TOXENV=py27-django-18
python: "2.7"
- env: TOXENV=py34-django-18
python: "3.4"
# Test with PostgreSQL
- TOXENV=py27-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-19-postgres"
- TOXENV=py35-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-19-postgres"
- TOXENV=py27-django-18-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-18-postgres"
- env: TOXENV=py27-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-110-postgres"
python: "2.7"
- env: TOXENV=py35-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-110-postgres"
python: "3.5"
- env: TOXENV=py27-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-19-postgres"
python: "2.7"
- env: TOXENV=py35-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-19-postgres"
python: "3.5"
- env: TOXENV=py27-django-18-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-18-postgres"
python: "2.7"
# Test with MySQL
- TOXENV=py27-django-19-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-19-mysql"
- TOXENV=py35-django-19-mysql DATABASE_URL="mysql://travis@localhost:3306/py35-django-19-mysql"
- TOXENV=py27-django-18-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-18-mysql"
- env: TOXENV=py27-django-110-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-110-mysql"
python: "2.7"
- env: TOXENV=py35-django-110-mysql DATABASE_URL="mysql://travis@localhost:3306/py35-django-110-mysql"
python: "3.5"
- env: TOXENV=py27-django-19-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-19-mysql"
python: "2.7"
- env: TOXENV=py35-django-19-mysql DATABASE_URL="mysql://travis@localhost:3306/py35-django-19-mysql"
python: "3.5"
- env: TOXENV=py27-django-18-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-18-mysql"
python: "2.7"
# Django master is allowed to fail
- TOXENV=py27-django-master
- TOXENV=py35-django-master
- TOXENV=py27-django-master-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-master-mysql"
- TOXENV=py35-django-master-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-master-postgres"
matrix:
- env: TOXENV=py27-django-master
python: "2.7"
- env: TOXENV=py35-django-master
python: "3.5"
- env: TOXENV=py27-django-master-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-master-mysql"
python: "2.7"
- env: TOXENV=py35-django-master-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-master-postgres"
python: "3.5"
allow_failures:
# Master is allowed to fail
- env: TOXENV=py27-django-master
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ recommended. It follows the `Django's support policy`_, supporting:

* Django 1.8 (LTS) with Python 2.7, 3.4, or 3.5
* Django 1.9 with Python 2.7, 3.4, or 3.5
* Django 1.10 with Python 2.7, 3.4, or 3.5

.. _latest release: https://pypi.python.org/pypi/nose
.. _Django's support policy: https://docs.djangoproject.com/en/1.8/internals/release-process/#supported-versions
Expand Down
6 changes: 6 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
---------

1.4.4 (2016-06-27)
~~~~~~~~~~~~~~~~~~
* Add Django 1.10 support
* Drop Django 1.4, 1.7, and Python 2.6 support
* Drop South support

1.4.3 (2015-12-28)
~~~~~~~~~~~~~~~~~~
* Add Django 1.9 support
Expand Down
4 changes: 2 additions & 2 deletions django_nose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from django_nose.runner import BasicNoseRunner, NoseTestSuiteRunner
from django_nose.testcases import FastFixtureTestCase
assert BasicNoseRunner
assert NoseTestSuiteRunner
assert FastFixtureTestCase

VERSION = (1, 4, 3)
VERSION = (1, 4, 4)
__version__ = '.'.join(map(str, VERSION))
run_tests = run_gis_tests = NoseTestSuiteRunner
21 changes: 8 additions & 13 deletions django_nose/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from django.apps import apps
from django.conf import settings
from django.core import exceptions
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.core.management.commands.loaddata import Command
from django.db import connections, transaction, DEFAULT_DB_ALIAS
Expand Down Expand Up @@ -149,21 +148,23 @@ def add_arguments(cls, parser):

# Process nose optparse options
for option in options:
# Skip any options also in Django options
# Gather options
opt_long = option.get_opt_string()
if opt_long in django_options:
continue
if option._short_opts:
opt_short = option._short_opts[0]
if opt_short in django_options:
continue
else:
opt_short = None

# Rename nose's --verbosity to --nose-verbosity
if opt_long == '--verbosity':
opt_long = '--nose-verbosity'

# Skip any options also in Django options
if opt_long in django_options:
continue
if opt_short and opt_short in django_options:
opt_short = None

# Convert optparse attributes to argparse attributes
option_attrs = {}
for attr in option.ATTRS:
Expand Down Expand Up @@ -271,12 +272,6 @@ def run_tests(self, test_labels, extra_tests=None):
if hasattr(settings, 'NOSE_ARGS'):
nose_argv.extend(settings.NOSE_ARGS)

# Skip over 'manage.py test' and any arguments handled by django.
django_opts = self.django_opts[:]
for opt in getattr(BaseCommand, 'option_list', []):
django_opts.extend(opt._long_opts)
django_opts.extend(opt._short_opts)

# Recreate the arguments in a nose-compatible format
arglist = sys.argv[1:]
has_nargs = getattr(self, '_has_nargs', set(['--verbosity']))
Expand All @@ -285,7 +280,7 @@ def run_tests(self, test_labels, extra_tests=None):
if not opt.startswith('-'):
# Discard test labels
continue
if any(opt.startswith(d) for d in django_opts):
if any(opt.startswith(d) for d in self.django_opts):
# Discard options handled by Djangp
continue

Expand Down
10 changes: 0 additions & 10 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,6 @@ and some of its own as functions. ::
assert_mail_count(count, msg=None)


Using With South
----------------

`South`_ installs its own test command that turns off migrations during
testing. Make sure that django-nose comes *after* ``south`` in
``INSTALLED_APPS`` so that django_nose's test command is used.

.. _South: http://south.aeracode.org/


Always Passing The Same Options
-------------------------------

Expand Down
7 changes: 5 additions & 2 deletions runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ reset_env
django_test "./manage.py test $NOINPUT" $TESTAPP_COUNT 'normal settings'

reset_env
export TEST_RUNNER="django_nose.run_tests"
django_test "./manage.py test $NOINPUT" $TESTAPP_COUNT 'django_nose.run_tests format'
export TEST_RUNNER="django_nose.NoseTestSuiteRunner"
django_test "./manage.py test $NOINPUT" $TESTAPP_COUNT 'test runner from environment'

reset_env
django_test "testapp/runtests.py testapp.test_only_this" 1 'via run_tests API'
Expand All @@ -165,6 +165,9 @@ django_test "./manage.py test unittests $NOINPUT" 4 'unittests'
reset_env
django_test "./manage.py test unittests --verbosity 1 $NOINPUT" 4 'argument option without equals'

reset_env
django_test "./manage.py test unittests --nose-verbosity=2 $NOINPUT" 4 'argument with equals'

reset_env
django_test "./manage.py test unittests --testrunner=testapp.custom_runner.CustomNoseTestSuiteRunner $NOINPUT" 4 'unittests with testrunner'

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ source = django_nose,testapp,unittests

[coverage:report]
omit =
testapp/south_migrations/*.py
testapp/migrations/*.py

[flake8]
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def get_long_description(title):
include_package_data=True,
zip_safe=False,
install_requires=['nose>=1.2.1'],
tests_require=['south>=0.7'],
test_suite='testapp.runtests.runtests',
# This blows up tox runs that install django-nose into a virtualenv,
# because it causes Nose to import django_nose.runner before the Django
Expand Down
4 changes: 0 additions & 4 deletions testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def rel_path(*subpaths):
'django_nose',
'testapp',
]
if environ.get('USE_SOUTH', '0') in (1, '1'):
import south # Raise ImportError if not installed
assert south
INSTALLED_APPS.insert(0, 'south')

raw_test_runner = environ.get('TEST_RUNNER')
if raw_test_runner:
Expand Down
54 changes: 0 additions & 54 deletions testapp/south_migrations/0001_initial.py

This file was deleted.

1 change: 0 additions & 1 deletion testapp/south_migrations/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
envlist =
{py27,py34,py35}-django-{18,19}
{py27,py34,py35}-django-master
{py27,py34,py35}-django-{18,19,110,master}
flake8
docs
skip_missing_interpreters = True
Expand All @@ -15,10 +14,11 @@ deps =
coveralls
dj-database-url
django-18: Django>=1.8,<1.9
django-19: Django==1.9,<1.10
django-19: Django>=1.9,<1.10
django-110: Django==1.10b1
django-master: https://github.com/django/django/archive/master.tar.gz
{py27,py34,py35}-django-{18,19,master}-postgres: psycopg2
{py27,py34,py35}-django-{18,19,master}-mysql: mysqlclient
{py27,py34,py35}-django-{18,19,110,master}-postgres: psycopg2
{py27,py34,py35}-django-{18,19,110,master}-mysql: mysqlclient

[testenv:flake8]
deps =
Expand Down

0 comments on commit 9403382

Please sign in to comment.