diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2023-04-02 22:12:51 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-02 22:12:51 (GMT) |
| commit | 6883007a86bdf0d7cf4560b949fd5e577dab1013 (patch) | |
| tree | b5585b8135e1136d9b567dda62e887a27033b392 /Lib/test/test_unittest/support.py | |
| parent | a0305c5fdfdef7a362d0262c54399c4a6013d1ea (diff) | |
| download | cpython-6883007a86bdf0d7cf4560b949fd5e577dab1013.zip cpython-6883007a86bdf0d7cf4560b949fd5e577dab1013.tar.gz cpython-6883007a86bdf0d7cf4560b949fd5e577dab1013.tar.bz2 | |
bpo-4080: unittest durations (#12271)
Diffstat (limited to 'Lib/test/test_unittest/support.py')
| -rw-r--r-- | Lib/test/test_unittest/support.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_unittest/support.py b/Lib/test/test_unittest/support.py index 5292653..8c97bf5 100644 --- a/Lib/test/test_unittest/support.py +++ b/Lib/test/test_unittest/support.py @@ -136,3 +136,19 @@ class ResultWithNoStartTestRunStopTestRun(object): def wasSuccessful(self): return True + + +class BufferedWriter: + def __init__(self): + self.result = '' + self.buffer = '' + + def write(self, arg): + self.buffer += arg + + def flush(self): + self.result += self.buffer + self.buffer = '' + + def getvalue(self): + return self.result |
