diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-27 21:27:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-27 21:27:13 (GMT) |
commit | f28ce60441e28ffcfca1eede81f906b30a3ab589 (patch) | |
tree | 0a16569d723eead8faf3115999412546b1f5307a /Lib/test/test_tracemalloc.py | |
parent | 3c0481d426d4c2953ade7371748486b8669c9d8b (diff) | |
download | cpython-f28ce60441e28ffcfca1eede81f906b30a3ab589.zip cpython-f28ce60441e28ffcfca1eede81f906b30a3ab589.tar.gz cpython-f28ce60441e28ffcfca1eede81f906b30a3ab589.tar.bz2 |
Closes #19786: tracemalloc, remove the arbitrary limit of 100 frames
The limit is now 178,956,969 on 64 bit (it is greater on 32 bit because
structures are smaller).
Use int instead of Py_ssize_t to store the number of frames to have smaller
traceback_t objects.
Diffstat (limited to 'Lib/test/test_tracemalloc.py')
-rw-r--r-- | Lib/test/test_tracemalloc.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index 8419a58..484e313 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -747,14 +747,14 @@ class TestCommandLine(unittest.TestCase): self.assertEqual(stdout, b'10') def test_env_var_invalid(self): - for nframe in (-1, 0, 5000): + for nframe in (-1, 0, 2**30): with self.subTest(nframe=nframe): with support.SuppressCrashReport(): ok, stdout, stderr = assert_python_failure( '-c', 'pass', PYTHONTRACEMALLOC=str(nframe)) - self.assertIn(b'PYTHONTRACEMALLOC must be an integer ' - b'in range [1; 100]', + self.assertIn(b'PYTHONTRACEMALLOC: invalid ' + b'number of frames', stderr) def test_sys_xoptions(self): @@ -770,13 +770,13 @@ class TestCommandLine(unittest.TestCase): self.assertEqual(stdout, str(nframe).encode('ascii')) def test_sys_xoptions_invalid(self): - for nframe in (-1, 0, 5000): + for nframe in (-1, 0, 2**30): with self.subTest(nframe=nframe): with support.SuppressCrashReport(): args = ('-X', 'tracemalloc=%s' % nframe, '-c', 'pass') ok, stdout, stderr = assert_python_failure(*args) - self.assertIn(b'-X tracemalloc=NFRAME: number of frame must ' - b'be an integer in range [1; 100]', + self.assertIn(b'-X tracemalloc=NFRAME: invalid ' + b'number of frames', stderr) |