Use test.test_support.captured_stdout instead of a custom contextmanager.
Thanks Nick Coghlan.
1 file changed