The unittest.TestProgram class accepts a "--verbose" command-line argument. But the setting only gets applied if the testRunner argument to unittest.TestProgram.__init__ is None. There is no clean way of creating a custom TestRunner class and passing it to unittest.TestProgram such that the correct verbosity is picked up. This patch slightly alters the interface to unittest.TestProgram.__init__ by allowing a class to be passed as the testRunner argument (defaulting to TextTestRunner instead of None). Then the runTests method of unittest.TestProgram checks whether self.testRunner is a class, and if so creates an instance of it, passing the correct verbosity setting to the TestRunner class' __init__ method. The patch should still allow a custom TestRunner class _instance_ to be passed to unittest.TestProgram.__init__.
Logged In: YES user_id=21477 I can see your point, but this requres every test runner to accept the 'verbosity' keyword argument. I'm worried that this will break a large number of custom test runners. Another approach might be to change TextTestRunner so that 'verbosity' is an instance attribute that is set by TestProgram after the test runner instance is created. Then existing custom test runners will not break, unless they already have a 'verbosity' attribute, which is unlikely. I'll bear this patch in mind; I'm looking at a few pending minor changes to the module, and this area is one that I'm covering.