diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-08 21:04:32 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-08 21:04:32 (GMT) |
commit | 77e904e6a6d8fefd8c6100ea33cf46fb69b45efd (patch) | |
tree | 4d28ca9d42d5f2ada23b443b4e26e8d23b2c49cc /Doc/library | |
parent | 3ebbb04af2c8d7bda2de941bf96205b154963316 (diff) | |
download | cpython-77e904e6a6d8fefd8c6100ea33cf46fb69b45efd.zip cpython-77e904e6a6d8fefd8c6100ea33cf46fb69b45efd.tar.gz cpython-77e904e6a6d8fefd8c6100ea33cf46fb69b45efd.tar.bz2 |
Issue #18948: improve SuppressCoreFiles to include Windows crash popup suppression, and use it in more tests.
Patch by Valerie Lambert and Zachary Ware.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/test.rst | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Doc/library/test.rst b/Doc/library/test.rst index c1270f4..2c51549 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -442,13 +442,6 @@ The :mod:`test.support` module defines the following functions: A decorator for running tests that require support for symbolic links. -.. function:: suppress_crash_popup() - - A context manager that disables Windows Error Reporting dialogs using - `SetErrorMode <http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx>`_. - On other platforms it's a no-op. - - .. decorator:: anticipate_failure(condition) A decorator to conditionally mark tests with @@ -593,6 +586,21 @@ The :mod:`test.support` module defines the following classes: Temporarily unset the environment variable ``envvar``. +.. class:: SuppressCrashReport() + + A context manager used to try to prevent crash dialog popups on tests that + are expected to crash a subprocess. + + On Windows, it disables Windows Error Reporting dialogs using + `SetErrorMode <http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx>`_. + + On UNIX, :func:`resource.setrlimit` is used to set + :attr:`resource.RLIMIT_CORE`'s soft limit to 0 to prevent coredump file + creation. + + On both platforms, the old value is restored by :meth:`__exit__`. + + .. class:: WarningsRecorder() Class used to record warnings for unit tests. See documentation of |