comparison tests/test_memory.py @ 39:a6bc019ac0b2 upstream

ADD: PyMuPDF v1.26.5: the original sdist.
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 11 Oct 2025 11:19:58 +0200
parents 1d09e1dec1d9
children
comparison
equal deleted inserted replaced
2:b50eed0cc0ef 39:a6bc019ac0b2
15 15
16 def test_2791(): 16 def test_2791():
17 ''' 17 '''
18 Check for memory leaks. 18 Check for memory leaks.
19 ''' 19 '''
20 if os.environ.get('PYODIDE_ROOT'):
21 print('test_2791(): not running on Pyodide - No module named \'psutil\'.')
22 return
23
20 if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1': 24 if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1':
21 print(f'test_2791(): not running because PYMUPDF_RUNNING_ON_VALGRIND=1.') 25 print(f'test_2791(): not running because PYMUPDF_RUNNING_ON_VALGRIND=1.')
22 return 26 return
23 if platform.system().startswith('MSYS_NT-'): 27 if platform.system().startswith('MSYS_NT-'):
24 print(f'test_2791(): not running on msys2 - psutil not available.') 28 print(f'test_2791(): not running on msys2 - psutil not available.')
92 else: 96 else:
93 pass 97 pass
94 98
95 99
96 def test_4090(): 100 def test_4090():
101 if os.environ.get('PYODIDE_ROOT'):
102 print('test_4090(): not running on Pyodide - No module named \'psutil\'.')
103 return
104
97 print(f'test_4090(): {os.environ.get("PYTHONMALLOC")=}.') 105 print(f'test_4090(): {os.environ.get("PYTHONMALLOC")=}.')
98 import psutil 106 import psutil
99 process = psutil.Process() 107 process = psutil.Process()
100 rsss = list() 108 rsss = list()
101 def rss(): 109 def rss():
146 print(f'{count_diff=} {size_diff=}') 154 print(f'{count_diff=} {size_diff=}')
147 155
148 156
149 157
150 def test_4125(): 158 def test_4125():
159 if os.environ.get('PYODIDE_ROOT'):
160 print('test_4125(): not running on Pyodide - No module named \'psutil\'.')
161 return
162
151 if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1': 163 if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1':
152 print(f'test_4125(): not running because PYMUPDF_RUNNING_ON_VALGRIND=1.') 164 print(f'test_4125(): not running because PYMUPDF_RUNNING_ON_VALGRIND=1.')
153 return 165 return
154 if platform.system().startswith('MSYS_NT-'): 166 if platform.system().startswith('MSYS_NT-'):
155 print(f'test_4125(): not running on msys2 - psutil not available.') 167 print(f'test_4125(): not running on msys2 - psutil not available.')