diff --git a/Doc/library/test.rst b/Doc/library/test.rst --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -400,16 +400,23 @@ The :mod:`test.support` module defines t otherwise. .. decorator:: skip_unless_symlink() A decorator for running tests that require support for symbolic links. +.. decorator:: skip_on_windows() + + A decorator that will skip the decorated test on Windows. + + .. versionadded:: 3.4 + + .. function:: suppress_crash_popup() A context manager that disables Windows Error Reporting dialogs using `SetErrorMode `_. On other platforms it's a no-op. .. decorator:: anticipate_failure(condition) diff --git a/Lib/test/support.py b/Lib/test/support.py --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -457,16 +457,18 @@ def requires_mac_ver(*min_version): "Mac OS X %s or higher required, not %s" % (min_version_txt, version_txt)) return func(*args, **kw) wrapper.min_version = min_version return wrapper return decorator +skip_on_windows = unittest.skipIf(sys.platform == 'win32', 'skipped on windows') + HOST = 'localhost' def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM): """Returns an unused port that should be suitable for binding. This is achieved by creating a temporary socket with the same family and type as the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to the specified host address (defaults to 0.0.0.0) with the port set to 0, eliciting an unused ephemeral port from the OS. The temporary socket is