diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-14 11:57:15 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-14 11:57:15 (GMT) |
commit | 63db5b65105adbb3038134f9a19d619fc5e8d638 (patch) | |
tree | b9a5558e8179764d41b22889778261d453ad6427 /Lib/test/support.py | |
parent | c3afbb95425b42de348ec4b0430f954a37d6ce20 (diff) | |
parent | 07352b084c725396bd74cef7c8204d16c4ab4a25 (diff) | |
download | cpython-63db5b65105adbb3038134f9a19d619fc5e8d638.zip cpython-63db5b65105adbb3038134f9a19d619fc5e8d638.tar.gz cpython-63db5b65105adbb3038134f9a19d619fc5e8d638.tar.bz2 |
Merge with 3.2 and also remove captured_output from __all__ (see #7960).
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r-- | Lib/test/support.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index d6f0e0d..e49453e 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -35,8 +35,8 @@ __all__ = [ "is_resource_enabled", "requires", "find_unused_port", "bind_port", "IPV6_ENABLED", "is_jython", "TESTFN", "HOST", "SAVEDCWD", "temp_cwd", "findfile", "sortdict", "check_syntax_error", "open_urlresource", - "check_warnings", "CleanImport", "EnvironmentVarGuard", - "TransientResource", "captured_output", "captured_stdout", "time_out", + "check_warnings", "CleanImport", "EnvironmentVarGuard", "TransientResource", + "captured_stdout", "captured_stdin", "captured_stderr", "time_out", "socket_peer_reset", "ioerror_peer_reset", "run_with_locale", 'temp_umask', "transient_internet", "set_memlimit", "bigmemtest", "bigaddrspacetest", "BasicTestRunner", "run_unittest", "run_doctest", "threading_setup", @@ -887,7 +887,7 @@ def transient_internet(resource_name, *, timeout=30.0, errnos=()): @contextlib.contextmanager def captured_output(stream_name): - """Return a context manager used by captured_stdout and captured_stdin + """Return a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream *stream_name* with a StringIO.""" import io orig_stdout = getattr(sys, stream_name) @@ -912,6 +912,7 @@ def captured_stderr(): def captured_stdin(): return captured_output("stdin") + def gc_collect(): """Force as many objects as possible to be collected. |