﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26981	Support passing custom kwargs to DiscoverRunner's test runner	Chris Jerdonek	Chris Jerdonek	"Currently, there doesn't seem to be a nice way to have Django pass custom kwargs to the underlying unittest test runner when running tests.

This is because Django hard-codes the kwargs it passes (see [https://github.com/django/django/blob/013ee21cf8e1a4b05589c161039f244e356272ba/django/test/runner.py#L505 here] for a direct link to the code):

{{{#!python
def run_suite(self, suite, **kwargs):
    resultclass = self.get_resultclass()
    return self.test_runner(
        verbosity=self.verbosity,
        failfast=self.failfast,
        resultclass=resultclass,
    ).run(suite)
}}}

Django's default test runner is `unittest.TextTestRunner`, and here are all of the kwargs that the runner currently supports (from the function signature in Python 3.5.2):

{{{#!python
class TextTestRunner(object):

    def __init__(self, stream=None, descriptions=True, verbosity=1,
                 failfast=False, buffer=False, resultclass=None, warnings=None,
                 *, tb_locals=False):
}}}

One approach to this ticket might involve having `run_suite()` pass its kwargs along to the test runner function (instead of ""swallowing"" them), and making whatever other code changes are needed to support this (e.g. modifying `run_tests()` to pass kwargs along to `run_suite()`). More focused approaches are also possible.
"	New feature	closed	Testing framework	dev	Normal	fixed			Accepted	1	0	0	0	0	0
