]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
More informative skip message in @bigaddrspace
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Jan 2011 21:50:44 +0000 (21:50 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Jan 2011 21:50:44 +0000 (21:50 +0000)
Lib/test/support.py

index 2062dd5cbadc902fe8b686aa59fd9ea182ceaac9..897d905f3ba62b2933b648fd818893c416cc32fc 100644 (file)
@@ -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