You can subclass Celery runner and Nose runner, then you get good sides for all of them.
from django_nose import NoseTestSuiteRunner
from djcelery.contrib.test_runner import CeleryTestSuiteRunner
class TestRunner(CeleryTestSuiteRunner, NoseTestSuiteRunner):
pass
Then in your settings:
TEST_RUNNER = '<package to>.TestRunner'
Why it works:
help(TestRunner)
You get:
| Method resolution order:
| TestRunner
| djcelery.contrib.test_runner.CeleryTestSuiteRunner
| django_nose.runner.NoseTestSuiteRunner
| django_nose.runner.BasicNoseRunner
| django_nose.runner.BaseRunner
| django.test.runner.DiscoverRunner
| builtins.object
The test CeleryTestRunner did nothing just setting some config and then call super().setup_test_environment()
. Then the super will looking for setup_test_environment() in that chain.
Watch the video from Raymond Hettinger: super considered super(here).