[Python-modules-commits] [django-nose] 01/12: Import django-nose_1.4.4.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Tue Oct 17 13:34:37 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository django-nose.
commit 3da74d573702cfc6da75793f639a1009613717c6
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Thu Jun 30 08:14:00 2016 +0200
Import django-nose_1.4.4.orig.tar.gz
---
.travis.yml | 76 +++---
README.rst | 7 +-
changelog.rst | 6 +
django_nose/__init__.py | 6 +-
django_nose/management/commands/test.py | 18 +-
django_nose/runner.py | 398 ++++++++++++-------------------
docs/usage.rst | 10 -
runtests.sh | 16 +-
setup.cfg | 1 -
setup.py | 3 +-
testapp/settings.py | 4 -
testapp/south_migrations/0001_initial.py | 54 -----
testapp/south_migrations/__init__.py | 1 -
tox.ini | 16 +-
14 files changed, 222 insertions(+), 394 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 68c5f29..2b3590c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,43 +3,63 @@ 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=py34-django-19
- - TOXENV=py27-django-18
- - TOXENV=py34-django-18
- - TOXENV=py27-django-17
- - TOXENV=py34-django-17
- - TOXENV=py26-django-14
- - TOXENV=py27-django-14
+ - 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=py34-django-19-postgres DATABASE_URL="postgres://postgres@localhost:5432/py34-django-19-postgres"
- - TOXENV=py27-django-18-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-18-postgres"
- - TOXENV=py27-django-17-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-17-postgres"
- - TOXENV=py27-django-14-postgres DATABASE_URL="postgres://postgres@localhost:5432/py27-django-14-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=py34-django-19-mysql DATABASE_URL="mysql://travis@localhost:3306/py34-django-19-mysql"
- - TOXENV=py27-django-18-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-18-mysql"
- - TOXENV=py27-django-17-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-17-mysql"
- - TOXENV=py27-django-14-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-14-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=py34-django-master
- - TOXENV=py27-django-master-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-master-mysql"
- - TOXENV=py34-django-master-postgres DATABASE_URL="postgres://postgres@localhost:5432/py34-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
- - env: TOXENV=py34-django-master
+ - env: TOXENV=py35-django-master
- env: TOXENV=py27-django-master-mysql DATABASE_URL="mysql://travis@localhost:3306/py27-django-master-mysql"
- - env: TOXENV=py34-django-master-postgres DATABASE_URL="postgres://postgres@localhost:5432/py34-django-master-postgres"
+ - env: TOXENV=py35-django-master-postgres DATABASE_URL="postgres://postgres@localhost:5432/py35-django-master-postgres"
install:
- pip install tox coveralls
diff --git a/README.rst b/README.rst
index 3429de8..047ab35 100644
--- a/README.rst
+++ b/README.rst
@@ -46,10 +46,9 @@ It also provides:
django-nose requires nose 1.2.1 or later, and the `latest release`_ is
recommended. It follows the `Django's support policy`_, supporting:
- * Django 1.4 (LTS) with Python 2.6 and 2.7
- * Django 1.7 with Python 2.7 or 3.4
- * Django 1.8 (LTS) with Python 2.7 or 3.4
- * Django 1.9 with Python 2.7 or 3.4
+ * 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
diff --git a/changelog.rst b/changelog.rst
index 830a14f..1512d4e 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -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
diff --git a/django_nose/__init__.py b/django_nose/__init__.py
index d18f29c..07d9bcb 100644
--- a/django_nose/__init__.py
+++ b/django_nose/__init__.py
@@ -5,10 +5,8 @@ from __future__ import unicode_literals
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))
-
-# Django < 1.2 compatibility.
-run_tests = run_gis_tests = NoseTestSuiteRunner
diff --git a/django_nose/management/commands/test.py b/django_nose/management/commands/test.py
index 1c29160..40390d7 100644
--- a/django_nose/management/commands/test.py
+++ b/django_nose/management/commands/test.py
@@ -7,24 +7,10 @@ This enables browsing all the nose options from the command line.
from __future__ import unicode_literals
from django.conf import settings
+from django.core.management.commands.test import Command
from django.test.utils import get_runner
-if 'south' in settings.INSTALLED_APPS:
- from south.management.commands.test import Command
-else:
- from django.core.management.commands.test import Command
-
-
-# Django < 1.2 compatibility
-test_runner = settings.TEST_RUNNER
-if test_runner.endswith('run_tests') or test_runner.endswith('run_gis_tests'):
- import warnings
- warnings.warn(
- 'Use `django_nose.NoseTestSuiteRunner` instead of `%s`' % test_runner,
- DeprecationWarning)
-
-
TestRunner = get_runner(settings)
if hasattr(TestRunner, 'options'):
@@ -36,4 +22,4 @@ else:
class Command(Command):
"""Implement the ``test`` command."""
- option_list = Command.option_list + tuple(extra_options)
+ option_list = getattr(Command, 'option_list', ()) + tuple(extra_options)
diff --git a/django_nose/runner.py b/django_nose/runner.py
index 485a9f4..14a26f4 100644
--- a/django_nose/runner.py
+++ b/django_nose/runner.py
@@ -9,57 +9,25 @@ in settings.py for arguments that you want always passed to nose.
"""
from __future__ import print_function, unicode_literals
+
import os
import sys
-from optparse import make_option, NO_DEFAULT
+from importlib import import_module
+from optparse import NO_DEFAULT
from types import MethodType
-import django
+from django import setup
+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
-
-try:
- from django.db.backends.base.creation import BaseDatabaseCreation
-except ImportError:
- # Django < 1.7
- from django.db.backends.creation import BaseDatabaseCreation
-
-try:
- from importlib import import_module
-except ImportError:
- # Django < 1.7 and Python < 2.7
- from django.utils.importlib import import_module
-
-try:
- from django.apps import apps
-except ImportError:
- # Django < 1.7
- from django.db.models.loading import cache as apps
-
-import nose.core
+from django.test.runner import DiscoverRunner
from django_nose.plugin import DjangoSetUpPlugin, ResultPlugin, TestReorderer
from django_nose.utils import uses_mysql
-
-try:
- any
-except NameError:
- def any(iterable):
- for element in iterable:
- if element:
- return True
- return False
-
-try:
- from django.test.runner import DiscoverRunner
-except ImportError:
- # Django < 1.8
- from django.test.simple import DjangoTestSuiteRunner as DiscoverRunner
-
+import nose.core
__all__ = ('BasicNoseRunner', 'NoseTestSuiteRunner')
@@ -77,18 +45,6 @@ def translate_option(opt):
return OPTION_TRANSLATION.get(opt, opt)
-# Django v1.2 does not have a _get_test_db_name() function.
-if not hasattr(BaseDatabaseCreation, '_get_test_db_name'):
- def _get_test_db_name(self):
- TEST_DATABASE_PREFIX = 'test_'
-
- if self.connection.settings_dict['TEST_NAME']:
- return self.connection.settings_dict['TEST_NAME']
- return TEST_DATABASE_PREFIX + self.connection.settings_dict['NAME']
-
- BaseDatabaseCreation._get_test_db_name = _get_test_db_name
-
-
def _get_plugins_from_settings():
plugins = (list(getattr(settings, 'NOSE_PLUGINS', [])) +
['django_nose.plugin.TestReorderer'])
@@ -116,193 +72,147 @@ def _get_plugins_from_settings():
yield p_class()
-def _get_options():
- """Return all nose options that don't conflict with django options."""
- cfg_files = nose.core.all_config_files()
- manager = nose.core.DefaultPluginManager()
- config = nose.core.Config(env=os.environ, files=cfg_files, plugins=manager)
- config.plugins.addPlugins(list(_get_plugins_from_settings()))
- options = config.getParser()._get_all_options()
-
- # copy nose's --verbosity option and rename to --nose-verbosity
- verbosity = [o for o in options if o.get_opt_string() == '--verbosity'][0]
- verbosity_attrs = dict((attr, getattr(verbosity, attr))
- for attr in verbosity.ATTRS
- if attr not in ('dest', 'metavar'))
- options.append(make_option('--nose-verbosity',
- dest='nose_verbosity',
- metavar='NOSE_VERBOSITY',
- **verbosity_attrs))
-
- # Django 1.6 introduces a "--pattern" option, which is shortened into "-p"
- # do not allow "-p" to collide with nose's "--plugins" option.
- plugins_option = [
- o for o in options if o.get_opt_string() == '--plugins'][0]
- plugins_option._short_opts.remove('-p')
-
- django_opts = [opt.dest for opt in BaseCommand.option_list] + ['version']
- return tuple(
- o for o in options if o.dest not in django_opts and o.action != 'help')
-
-
-if hasattr(BaseCommand, 'use_argparse'):
- # Django 1.8 and later uses argparse.ArgumentParser
- # Translate nose optparse arguments to argparse
- class BaseRunner(DiscoverRunner):
-
- # Don't pass the following options to nosetests
- django_opts = [
- '--noinput', '--liveserver', '-p', '--pattern', '--testrunner',
- '--settings',
- # 1.8 arguments
- '--keepdb', '--reverse', '--debug-sql',
- # 1.9 arguments
- '--parallel',
- ]
-
- #
- # For optparse -> argparse conversion
- #
- # Option strings to remove from Django options if found
- _argparse_remove_options = (
- '-p', # Short arg for nose's --plugins, not Django's --patterns
- '-d', # Short arg for nose's --detailed-errors, not Django's
- # --debug-sql
- )
-
- # Convert nose optparse options to argparse options
- _argparse_type = {
- 'int': int,
- 'float': float,
- 'complex': complex,
- 'string': str,
- 'choice': str,
- }
- # If optparse has a None argument, omit from call to add_argument
- _argparse_omit_if_none = (
- 'action', 'nargs', 'const', 'default', 'type', 'choices',
- 'required', 'help', 'metavar', 'dest')
-
- # Always ignore these optparse arguments
- # Django will parse without calling the callback
- # nose will then reparse with the callback
- _argparse_callback_options = (
- 'callback', 'callback_args', 'callback_kwargs')
-
- # Keep track of nose options with nargs=1
- _has_nargs = set(['--verbosity'])
-
- @classmethod
- def add_arguments(cls, parser):
- """Convert nose's optparse arguments to argparse."""
- super(BaseRunner, cls).add_arguments(parser)
-
- # Read optparse options for nose and plugins
- cfg_files = nose.core.all_config_files()
- manager = nose.core.DefaultPluginManager()
- config = nose.core.Config(
- env=os.environ, files=cfg_files, plugins=manager)
- config.plugins.addPlugins(list(_get_plugins_from_settings()))
- options = config.getParser()._get_all_options()
-
- # Gather existing option strings`
- django_options = set()
- for action in parser._actions:
- for override in cls._argparse_remove_options:
- if override in action.option_strings:
- # Emulate parser.conflict_handler='resolve'
- parser._handle_conflict_resolve(
- None, ((override, action),))
- django_options.update(action.option_strings)
-
- # Process nose optparse options
- for option in options:
- # Skip any options also in Django options
- opt_long = option.get_opt_string()
- if opt_long in django_options:
+class BaseRunner(DiscoverRunner):
+ """Runner that translates nose optparse arguments to argparse.
+
+ Django 1.8 and later uses argparse.ArgumentParser. Nose's optparse
+ arguments need to be translated to this format, so that the Django
+ command line parsing will pass. This parsing is (mostly) thrown out,
+ and reassembled into command line arguments for nose to reparse.
+ """
+
+ # Don't pass the following options to nosetests
+ django_opts = [
+ '--noinput', '--liveserver', '-p', '--pattern', '--testrunner',
+ '--settings',
+ # 1.8 arguments
+ '--keepdb', '--reverse', '--debug-sql',
+ # 1.9 arguments
+ '--parallel',
+ ]
+
+ #
+ # For optparse -> argparse conversion
+ #
+ # Option strings to remove from Django options if found
+ _argparse_remove_options = (
+ '-p', # Short arg for nose's --plugins, not Django's --patterns
+ '-d', # Short arg for nose's --detailed-errors, not Django's
+ # --debug-sql
+ )
+
+ # Convert nose optparse options to argparse options
+ _argparse_type = {
+ 'int': int,
+ 'float': float,
+ 'complex': complex,
+ 'string': str,
+ 'choice': str,
+ }
+ # If optparse has a None argument, omit from call to add_argument
+ _argparse_omit_if_none = (
+ 'action', 'nargs', 'const', 'default', 'type', 'choices',
+ 'required', 'help', 'metavar', 'dest')
+
+ # Always ignore these optparse arguments
+ # Django will parse without calling the callback
+ # nose will then reparse with the callback
+ _argparse_callback_options = (
+ 'callback', 'callback_args', 'callback_kwargs')
+
+ # Keep track of nose options with nargs=1
+ _has_nargs = set(['--verbosity'])
+
+ @classmethod
+ def add_arguments(cls, parser):
+ """Convert nose's optparse arguments to argparse."""
+ super(BaseRunner, cls).add_arguments(parser)
+
+ # Read optparse options for nose and plugins
+ cfg_files = nose.core.all_config_files()
+ manager = nose.core.DefaultPluginManager()
+ config = nose.core.Config(
+ env=os.environ, files=cfg_files, plugins=manager)
+ config.plugins.addPlugins(list(_get_plugins_from_settings()))
+ options = config.getParser()._get_all_options()
+
+ # Gather existing option strings`
+ django_options = set()
+ for action in parser._actions:
+ for override in cls._argparse_remove_options:
+ if override in action.option_strings:
+ # Emulate parser.conflict_handler='resolve'
+ parser._handle_conflict_resolve(
+ None, ((override, action),))
+ django_options.update(action.option_strings)
+
+ # Process nose optparse options
+ for option in options:
+ # Gather options
+ opt_long = option.get_opt_string()
+ if option._short_opts:
+ opt_short = option._short_opts[0]
+ 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:
+ # Ignore callback options
+ if attr in cls._argparse_callback_options:
+ continue
+
+ value = getattr(option, attr)
+
+ if attr == 'default' and value == NO_DEFAULT:
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'
-
- # Convert optparse attributes to argparse attributes
- option_attrs = {}
- for attr in option.ATTRS:
- # Ignore callback options
- if attr in cls._argparse_callback_options:
- continue
-
- value = getattr(option, attr)
-
- if attr == 'default' and value == NO_DEFAULT:
- continue
-
- # Rename options for nose's --verbosity
- if opt_long == '--nose-verbosity':
- if attr == 'dest':
- value = 'nose_verbosity'
- elif attr == 'metavar':
- value = 'NOSE_VERBOSITY'
-
- # Omit arguments that are None, use default
- if attr in cls._argparse_omit_if_none and value is None:
- continue
-
- # Convert type from optparse string to argparse type
- if attr == 'type':
- value = cls._argparse_type[value]
-
- # Convert action='callback' to action='store'
- if attr == 'action' and value == 'callback':
- action = 'store'
-
- # Keep track of nargs=1
- if attr == 'nargs':
- assert value == 1, (
- 'argparse option nargs=%s is not supported' %
- value)
- cls._has_nargs.add(opt_long)
- if opt_short:
- cls._has_nargs.add(opt_short)
-
- # Pass converted attribute to optparse option
- option_attrs[attr] = value
-
- # Add the optparse argument
- if opt_short:
- parser.add_argument(opt_short, opt_long, **option_attrs)
- else:
- parser.add_argument(opt_long, **option_attrs)
-else:
- # Django 1.7 and earlier use optparse
- class BaseRunner(DiscoverRunner):
- # Replace the builtin options with the merged django/nose options:
- options = _get_options()
-
- # Not add following options to nosetests
- django_opts = [
- '--noinput', '--liveserver', '-p', '--pattern', '--testrunner']
-
- # Default nosetest options with an argument
- _has_nargs = set([
- '--attr', '--config', '--cover-html-dir', '--cover-min-percentage',
- '--cover-package', '--cover-xml-file', '--debug', '--debug-log',
- '--doctest-extension', '--doctest-fixtures', '--doctest-options',
- '--doctest-result-variable', '--eval-attr', '--exclude',
- '--id-file', '--ignore-files', '--include', '--logging-config',
- '--logging-datefmt', '--logging-filter', '--logging-format',
- '--logging-level', '--match', '--process-timeout', '--processes',
- '--profile-restrict', '--profile-sort', '--profile-stats-file',
- '--py3where', '--tests', u'--verbosity', '--where', '--xunit-file',
- '--xunit-testsuite-name', '-A', '-I', '-a', '-c', '-e', '-i', '-l',
- '-m', '-w'])
+
+ # Rename options for nose's --verbosity
+ if opt_long == '--nose-verbosity':
+ if attr == 'dest':
+ value = 'nose_verbosity'
+ elif attr == 'metavar':
+ value = 'NOSE_VERBOSITY'
+
+ # Omit arguments that are None, use default
+ if attr in cls._argparse_omit_if_none and value is None:
+ continue
+
+ # Convert type from optparse string to argparse type
+ if attr == 'type':
+ value = cls._argparse_type[value]
+
+ # Convert action='callback' to action='store'
+ if attr == 'action' and value == 'callback':
+ action = 'store'
+
+ # Keep track of nargs=1
+ if attr == 'nargs':
+ assert value == 1, (
+ 'argparse option nargs=%s is not supported' %
+ value)
+ cls._has_nargs.add(opt_long)
+ if opt_short:
+ cls._has_nargs.add(opt_short)
+
+ # Pass converted attribute to optparse option
+ option_attrs[attr] = value
+
+ # Add the optparse argument
+ if opt_short:
+ parser.add_argument(opt_short, opt_long, **option_attrs)
+ else:
+ parser.add_argument(opt_long, **option_attrs)
class BasicNoseRunner(BaseRunner):
@@ -325,11 +235,7 @@ class BasicNoseRunner(BaseRunner):
for plugin in _get_plugins_from_settings():
plugins_to_add.append(plugin)
- try:
- django.setup()
- except AttributeError:
- # Setup isn't necessary in Django < 1.7
- pass
+ setup()
nose.core.TestProgram(argv=nose_argv, exit=False,
addplugins=plugins_to_add)
@@ -366,12 +272,6 @@ class BasicNoseRunner(BaseRunner):
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 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']))
@@ -380,7 +280,7 @@ class BasicNoseRunner(BaseRunner):
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
diff --git a/docs/usage.rst b/docs/usage.rst
index ffbc1ca..219d190 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -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
-------------------------------
diff --git a/runtests.sh b/runtests.sh
index f825e3a..da6ee27 100755
--- a/runtests.sh
+++ b/runtests.sh
@@ -47,7 +47,6 @@ else:
")
reset_env() {
- unset USE_SOUTH
unset TEST_RUNNER
unset NOSE_PLUGINS
unset REUSE_DB
@@ -149,17 +148,9 @@ TESTAPP_COUNT=6
reset_env
django_test "./manage.py test $NOINPUT" $TESTAPP_COUNT 'normal settings'
-DJANGO_VERSION=`./manage.py version | cut -d. -f1-2`
-if [ "$DJANGO_VERSION" = "1.4" -o "$DJANGO_VERSION" = "1.5" -o "$DJANGO_VERSION" = "1.6" ]
-then
- reset_env
- export USE_SOUTH=1
- django_test "./manage.py test $NOINPUT" $TESTAPP_COUNT 'with south in installed apps'
-fi
-
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'
@@ -175,6 +166,9 @@ 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'
reset_env
diff --git a/setup.cfg b/setup.cfg
index b9640ea..6fe40b5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -9,7 +9,6 @@ source = django_nose,testapp,unittests
[coverage:report]
omit =
- testapp/south_migrations/*.py
testapp/migrations/*.py
[flake8]
diff --git a/setup.py b/setup.py
index 2b9f8fc..e9ff421 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ _(Older changes can be found in the full documentation)._
setup(
name='django-nose',
- version='1.4.3',
+ version='1.4.4',
description='Makes your Django tests simple and snappy',
long_description=get_long_description('django-nose'),
author='Jeff Balogh',
@@ -49,7 +49,6 @@ setup(
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
diff --git a/testapp/settings.py b/testapp/settings.py
index d204545..51a157f 100644
--- a/testapp/settings.py
+++ b/testapp/settings.py
@@ -32,10 +32,6 @@ INSTALLED_APPS = [
'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:
diff --git a/testapp/south_migrations/0001_initial.py b/testapp/south_migrations/0001_initial.py
deleted file mode 100644
index 021b439..0000000
--- a/testapp/south_migrations/0001_initial.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-# flake8: noqa
-from south.utils import datetime_utils as datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'Question'
- db.create_table('testapp_question', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('question_text', self.gf('django.db.models.fields.CharField')(max_length=200)),
- ('pub_date', self.gf('django.db.models.fields.DateTimeField')()),
- ))
- db.send_create_signal('testapp', ['Question'])
-
- # Adding model 'Choice'
- db.create_table('testapp_choice', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('question', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['testapp.Question'])),
- ('choice_text', self.gf('django.db.models.fields.CharField')(max_length=200)),
- ('votes', self.gf('django.db.models.fields.IntegerField')(default=0)),
- ))
- db.send_create_signal('testapp', ['Choice'])
-
-
- def backwards(self, orm):
- # Deleting model 'Question'
- db.delete_table('testapp_question')
-
- # Deleting model 'Choice'
- db.delete_table('testapp_choice')
-
-
- models = {
- 'testapp.choice': {
- 'Meta': {'object_name': 'Choice'},
- 'choice_text': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'question': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['testapp.Question']"}),
- 'votes': ('django.db.models.fields.IntegerField', [], {'default': '0'})
- },
- 'testapp.question': {
- 'Meta': {'object_name': 'Question'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'pub_date': ('django.db.models.fields.DateTimeField', [], {}),
- 'question_text': ('django.db.models.fields.CharField', [], {'max_length': '200'})
- }
- }
-
- complete_apps = ['testapp']
diff --git a/testapp/south_migrations/__init__.py b/testapp/south_migrations/__init__.py
deleted file mode 100644
index 48f2e4f..0000000
--- a/testapp/south_migrations/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-"""South migrations for Django 1.6 and earlier."""
diff --git a/tox.ini b/tox.ini
index 25ecd8f..fd3f0ca 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,8 +1,6 @@
[tox]
envlist =
- {py26,py27}-django-14
- {py27,py34,py35}-django-{17,18,19}
- {py27,py34,py35}-django-master
+ {py27,py34,py35}-django-{18,19,110,master}
flake8
docs
skip_missing_interpreters = True
@@ -15,18 +13,16 @@ commands =
deps =
coveralls
dj-database-url
- django-14: Django>=1.4,<1.5
- django-14: South
- django-17: Django>=1.7,<1.8
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
- {py26,py27,py34,py35}-django-{14,17,18,19,master}-postgres: psycopg2
- {py26,py27,py34,py35}-django-{14,17,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 =
- Django>=1.9,<1.10
+ Django
pep257==0.7.0
pep8==1.6.2
flake8==2.5.0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-nose.git
More information about the Python-modules-commits
mailing list