]> granicus.if.org Git - python/commitdiff
Issue #14554: merge with 3.2
authorSandro Tosi <sandro.tosi@gmail.com>
Tue, 24 Apr 2012 16:39:53 +0000 (18:39 +0200)
committerSandro Tosi <sandro.tosi@gmail.com>
Tue, 24 Apr 2012 16:39:53 +0000 (18:39 +0200)
1  2 
Doc/library/test.rst

index 8b998f6740542a911bf599bb8dc6ae407bb5c547,40f4115ead00d19dcb206999722546c9f2083ec2..2e8ba328b3505efe3001675bf86b726756789e7e
@@@ -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