From f28ce60441e28ffcfca1eede81f906b30a3ab589 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 27 Nov 2013 22:27:13 +0100 Subject: 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. --- Lib/test/test_tracemalloc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Lib/test/test_tracemalloc.py') diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index 8419a58d662..484e313a1a9 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) -- cgit v1.2.3