From: Antoine Pitrou Date: Wed, 12 Jan 2011 21:50:44 +0000 (+0000) Subject: More informative skip message in @bigaddrspace X-Git-Tag: v3.2rc1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0d3f8a654a80102a7646ba1dac9bec2bbc27fc9;p=thirdparty%2FPython%2Fcpython.git More informative skip message in @bigaddrspace --- diff --git a/Lib/test/support.py b/Lib/test/support.py index 2062dd5cbadc..897d905f3ba6 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -1039,9 +1039,13 @@ def bigaddrspacetest(f): """Decorator for tests that fill the address space.""" def wrapper(self): if max_memuse < MAX_Py_ssize_t: - if verbose: - sys.stderr.write("Skipping %s because of memory " - "constraint\n" % (f.__name__,)) + if MAX_Py_ssize_t > 2**32: + raise unittest.SkipTest( + "not enough memory: try a 32-bit build instead") + else: + raise unittest.SkipTest( + "not enough memory: %.1fG minimum needed" + % (MAX_Py_ssize_t / (1024 ** 3))) else: return f(self) return wrapper