From: Sandro Tosi Date: Tue, 24 Apr 2012 16:39:53 +0000 (+0200) Subject: Issue #14554: merge with 3.2 X-Git-Tag: v3.3.0a3~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0c10f084022073c76d12ff66525e1b52d7188b7;p=python Issue #14554: merge with 3.2 --- f0c10f084022073c76d12ff66525e1b52d7188b7 diff --cc Doc/library/test.rst index 8b998f6740,40f4115ead..2e8ba328b3 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@@ -372,60 -362,9 +372,60 @@@ The :mod:`test.support` module defines with captured_stdout() as s: print("hello") - assert s.getvalue() == "hello" + assert s.getvalue() == "hello\n" +.. function:: temp_cwd(name='tempcwd', quiet=False, path=None) + + A context manager that temporarily changes the current working + directory (CWD). + + An existing path may be provided as *path*, in which case this function + makes no changes to the file system. + + Otherwise, the new CWD is created in the current directory and it's named + *name*. If *quiet* is ``False`` and it's not possible to create or + change the CWD, an error is raised. If it's ``True``, only a warning + is raised and the original CWD is used. + + +.. function:: temp_umask(umask) + + A context manager that temporarily sets the process umask. + + +.. function:: can_symlink() + + Return ``True`` if the OS supports symbolic links, ``False`` + otherwise. + + +.. decorator:: skip_unless_symlink() + + A decorator for running tests that require support for symbolic links. + + +.. decorator:: anticipate_failure(condition) + + A decorator to conditionally mark tests with + :func:`unittest.expectedFailure`. Any use of this decorator should + have an associated comment identifying the relevant tracker issue. + + +.. decorator:: run_with_locale(catstr, *locales) + + A decorator for running a function in a different locale, correctly + resetting it after it has finished. *catstr* is the locale category as + a string (for example ``"LC_ALL"``). The *locales* passed will be tried + sequentially, and the first valid locale will be used. + + +.. function:: make_bad_fd() + + Create an invalid file descriptor by opening and closing a temporary file, + and returning its descripor. + + .. function:: import_module(name, deprecated=False) This function imports and returns the named module. Unlike a normal