Skip to content

Commit

Permalink
Remove django-nose test runner support
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Jan 13, 2018
1 parent 988a6c8 commit 7889ee8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 47 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -13,6 +13,7 @@ History
* Fixed persistent option behavior with arbitrary commands
* Added minimal changes to allow third party application to run test on django 2.0
* Fixed options for channels runserver
* Removed support for django-nose test runner

1.0.0 (2017-07-25)
++++++++++++++++++
Expand Down
5 changes: 4 additions & 1 deletion README.rst
Expand Up @@ -22,10 +22,13 @@ Supported versions

Python: 2.7, 3.4, 3.5, 3.6

Django: 1.8 to 1.11
Django: 1.8 to 1.11 (limited 2.0 support)

django CMS: 3.4

.. warning:: Starting from version 1.1, compatibily nose test runnerhas been dropped.
Pin your test requirements accordingly (``djangocms-helper<1.0``).

.. warning:: Starting from version 1.0, compatibily with Python 2.6, Python 3.3, Django<=1.7 and
django CMS<=3.3 has been dropped. Pin your test requirements accordingly
(``djangocms-helper<1.0``).
Expand Down
12 changes: 2 additions & 10 deletions djangocms_helper/main.py
Expand Up @@ -25,7 +25,7 @@
dj-database-url compatible value.
Usage:
djangocms-helper <application> test [--failfast] [--migrate] [--no-migrate] [<test-label>...] [--xvfb] [--runner=<test.runner.class>] [--extra-settings=</path/to/settings.py>] [--cms] [--nose-runner] [--runner-options=<option1>,<option2>] [--native] [--boilerplate] [--persistent] [--persistent-path=<path>] [--verbose=<level>]
djangocms-helper <application> test [--failfast] [--migrate] [--no-migrate] [<test-label>...] [--xvfb] [--runner=<test.runner.class>] [--extra-settings=</path/to/settings.py>] [--cms] [--runner-options=<option1>,<option2>] [--native] [--boilerplate] [--persistent] [--persistent-path=<path>] [--verbose=<level>]
djangocms-helper <application> cms_check [--extra-settings=</path/to/settings.py>] [--cms] [--migrate] [--no-migrate] [--boilerplate]
djangocms-helper <application> compilemessages [--extra-settings=</path/to/settings.py>] [--cms] [--boilerplate]
djangocms-helper <application> makemessages [--extra-settings=</path/to/settings.py>] [--cms] [--boilerplate] [--locale=locale]
Expand All @@ -45,7 +45,6 @@
--merge Merge migrations
--failfast Stop tests on first failure.
--native Use the native test command, instead of the djangocms-helper on
--nose-runner Use django-nose as test runner
--boilerplate Add support for aldryn-boilerplates
--persistent Use persistent storage
--persistent-path=<path> Persistent storage path
Expand Down Expand Up @@ -74,11 +73,6 @@ def _test_run_worker(test_labels, test_runner, failfast=False, runner_options=[]
settings.TEST_RUNNER = test_runner
TestRunner = get_runner(settings)

# Monkeypatching sys.argv to avoid passing to nose unwanted arguments
if test_runner == 'django_nose.NoseTestSuiteRunner': # pragma: no cover
sys.argv = sys.argv[:2]
if failfast:
sys.argv.append('-x')
if runner_options:
sys.argv.extend(runner_options.split(','))
test_runner = TestRunner(verbosity=verbose, interactive=False, failfast=failfast)
Expand Down Expand Up @@ -327,9 +321,7 @@ def core(args, application):
_make_settings(args, application, settings, STATIC_ROOT, MEDIA_ROOT)
# run
if args['test']:
if args['--nose-runner']:
runner = 'django_nose.NoseTestSuiteRunner'
elif args['--runner']:
if args['--runner']:
runner = args['--runner']
else:
runner = 'django.test.runner.DiscoverRunner'
Expand Down
22 changes: 0 additions & 22 deletions djangocms_helper/tests/test_commands.py
Expand Up @@ -39,7 +39,6 @@
'--xvfb': '',
'--runner': None,
'--runner-options': None,
'--nose-runner': False,
'--cms': True,
'--failfast': False,
'--merge': False,
Expand Down Expand Up @@ -148,7 +147,6 @@ def test_map_argv(self):
'--migrate': False,
'--native': False,
'--no-migrate': False,
'--nose-runner': False,
'--persistent': True,
'--persistent-path': 'test',
'--port': '8000',
Expand Down Expand Up @@ -196,7 +194,6 @@ def test_map_argv(self):
'--migrate': False,
'--native': False,
'--no-migrate': False,
'--nose-runner': False,
'--persistent': True,
'--persistent-path': 'test',
'--port': '8000',
Expand Down Expand Up @@ -245,7 +242,6 @@ def test_map_argv(self):
'--migrate': False,
'--native': False,
'--no-migrate': False,
'--nose-runner': False,
'--persistent': True,
'--persistent-path': 'test',
'--port': '8000',
Expand Down Expand Up @@ -711,24 +707,6 @@ def test_setup_nocms(self):
self.assertFalse('aldryn_boilerplates' in settings.INSTALLED_APPS)
self.assertFalse('cms' in settings.INSTALLED_APPS)

def test_runner_nose(self):
try:
import cms
except ImportError:
raise unittest.SkipTest('django CMS not available, skipping test')
with work_in(self.basedir):
with captured_output() as (out, err):
with self.assertRaises(SystemExit) as exit:
args = list()
args.append('djangocms_helper')
args.append('test')
args.append('example1')
args.append('--nose-runner')
args.append('example1.tests')
runner.cms('example1', args)
self.assertTrue('Ran 28 tests in' in err.getvalue())
self.assertEqual(exit.exception.code, 0)

def test_testrun_nocms(self):
with work_in(self.basedir):
with captured_output() as (out, err):
Expand Down
10 changes: 2 additions & 8 deletions docs/reference.rst
Expand Up @@ -45,7 +45,7 @@ test

::

djangocms-helper <application> test [--failfast] [--migrate] [<test-label>...] [--xvfb] [--runner=<test.runner.class>] [--extra-settings=</path/to/settings.py>] [--cms] [--nose-runner] [--simple-runner] [--runner-options=<option1>,<option2>]
djangocms-helper <application> test [--failfast] [--migrate] [<test-label>...] [--xvfb] [--runner=<test.runner.class>] [--extra-settings=</path/to/settings.py>] [--cms] [--simple-runner] [--runner-options=<option1>,<option2>]

Example: ``djangocms-helper some_application test --cms``

Expand Down Expand Up @@ -73,7 +73,6 @@ Options
* ``--no-migrate``: skip migrations;
* ``--boilerplate``: adds ``aldryn-boilerplates`` configuration to settings;
* ``--xvfb``: whether to configure ``xvfb`` (for frontend tests);
* ``--nose-runner``: use django nose test suite
* ``--simple-runner`` use Django DjangoTestSuiteRunner
* ``--native`` use the native Django command: the use of this option is **incompatible** with
the options above.
Expand Down Expand Up @@ -102,12 +101,7 @@ Currently two different tests layouts are supported:

Depending on the used test runner you may need to setup your tests accordingly.

Currently supported test runners are:

* Django's DiscoverRunner (default on Django 1.6+)
* Nose's NoseTestSuiteRunner (option ``--nose-runner``)

You can also specify your own custom runner with the ``--runner`` option.
The default runner is the Django one, but it's possible to specify your own custom runner with the ``--runner`` option.


cms_check
Expand Down
1 change: 0 additions & 1 deletion requirements-test.txt
Expand Up @@ -3,5 +3,4 @@ coverage
coveralls
wheel
tox>=1.8
django-nose
aldryn-boilerplates
5 changes: 0 additions & 5 deletions tox.ini
Expand Up @@ -7,20 +7,15 @@ commands={env:COMMAND:python} setup.py test
deps=
django18: django>=1.8,<1.9
django18: django-mptt>0.8
django18: django-nose<1.5
django19: django>=1.9,<1.10
django19: django-mptt>0.8
django19: django-nose<1.5
django110: django>=1.10,<1.11
django110: django-mptt>0.8
django110: django-nose<1.5
django111: django>=1.11,<2
django111: django-mptt>0.8
django111: django-nose<1.5
django111: easy-thumbnails>2.4
django20: django>=2,<2.1
django20: django-mptt>0.8
django20: django-nose<1.5
django20: easy-thumbnails>2.4
https://github.com/divio/django-filer/archive/develop.zip
cms34: https://github.com/divio/django-cms/archive/release/3.4.x.zip
Expand Down

0 comments on commit 7889ee8

Please sign in to comment.