diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-08-06 10:09:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 10:09:06 -0700 |
commit | a5d99632766b458b42f327e8bd0f82b0345c9a63 (patch) | |
tree | 1561e7a0ce97fbc1fd4c8b321539b248b8db64e7 /Lib/test/test_decimal.py | |
parent | 36a2497093f0c66c2fb1667308691561c1bbe3f4 (diff) | |
download | cpython-git-a5d99632766b458b42f327e8bd0f82b0345c9a63.tar.gz |
bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783)
* When trying to allocate very large regions on macOS, malloc does not fail silently. It sends a noisy error out to STDERR
* This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS.
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
(cherry picked from commit 15d3c14df32a35ac69898a7852115722e30d7857)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r-- | Lib/test/test_decimal.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 058829b03a..28d56909b3 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -36,7 +36,8 @@ from test.support import (run_unittest, run_doctest, is_resource_enabled, requires_IEEE_754, requires_docstrings, requires_legacy_unicode_capi) from test.support import (TestFailed, - run_with_locale, cpython_only) + run_with_locale, cpython_only, + darwin_malloc_err_warning) from test.support.import_helper import import_fresh_module from test.support import warnings_helper import random @@ -44,6 +45,10 @@ import inspect import threading +if sys.platform == 'darwin': + darwin_malloc_err_warning('test_decimal') + + C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) orig_sys_decimal = sys.modules['decimal'] |