diff options
Diffstat (limited to 'Lib/unittest/runner.py')
-rw-r--r-- | Lib/unittest/runner.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py index 28b8865..2112262 100644 --- a/Lib/unittest/runner.py +++ b/Lib/unittest/runner.py @@ -126,7 +126,13 @@ class TextTestRunner(object): resultclass = TextTestResult def __init__(self, stream=None, descriptions=True, verbosity=1, - failfast=False, buffer=False, resultclass=None, warnings=None): + failfast=False, buffer=False, resultclass=None, warnings=None, + *, tb_locals=False): + """Construct a TextTestRunner. + + Subclasses should accept **kwargs to ensure compatibility as the + interface changes. + """ if stream is None: stream = sys.stderr self.stream = _WritelnDecorator(stream) @@ -134,6 +140,7 @@ class TextTestRunner(object): self.verbosity = verbosity self.failfast = failfast self.buffer = buffer + self.tb_locals = tb_locals self.warnings = warnings if resultclass is not None: self.resultclass = resultclass @@ -147,6 +154,7 @@ class TextTestRunner(object): registerResult(result) result.failfast = self.failfast result.buffer = self.buffer + result.tb_locals = self.tb_locals with warnings.catch_warnings(): if self.warnings: # if self.warnings is set, use it to filter all the warnings |