summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-05-29 14:36:44 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-05-29 14:36:44 (GMT)
commit2d517218320af6f752eaf1fbd96466e8d13d2d20 (patch)
tree5267963086203ea7d18b8bcca1d9969e1420c021 /Lib/test/support.py
parentb30eed981f54711d0a27ced68e15b8a5dd9934bc (diff)
downloadcpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.zip
cpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.tar.gz
cpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.tar.bz2
Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than the
underlying OS pipe buffer size.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index b03069c..6724e9b 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -48,7 +48,7 @@ __all__ = [
"threading_cleanup", "reap_children", "cpython_only", "check_impl_detail",
"get_attribute", "swap_item", "swap_attr", "requires_IEEE_754",
"TestHandler", "Matcher", "can_symlink", "skip_unless_symlink",
- "import_fresh_module", "requires_zlib"
+ "import_fresh_module", "requires_zlib", "PIPE_MAX_SIZE"
]
class Error(Exception):
@@ -409,6 +409,13 @@ def _is_ipv6_enabled():
IPV6_ENABLED = _is_ipv6_enabled()
+
+# A constant likely larger than the underlying OS pipe buffer size.
+# Windows limit seems to be around 512B, and most Unix kernels have a 64K pipe
+# buffer size: take 1M to be sure.
+PIPE_MAX_SIZE = 1024 * 1024
+
+
# decorator for skipping tests on non-IEEE 754 platforms
requires_IEEE_754 = unittest.skipUnless(
float.__getformat__("double").startswith("IEEE"),