1919
2020
2121def test_start_twice ():
22- _memalloc .start (64 , 1000 , 512 )
22+ _memalloc .start (64 , 512 )
2323 with pytest .raises (RuntimeError ):
24- _memalloc .start (64 , 1000 , 512 )
24+ _memalloc .start (64 , 512 )
2525 _memalloc .stop ()
2626
2727
2828def test_start_wrong_arg ():
29- with pytest .raises (TypeError , match = "function takes exactly 3 arguments \\ (1 given\\ )" ):
29+ with pytest .raises (TypeError , match = "function takes exactly 2 arguments \\ (1 given\\ )" ):
3030 _memalloc .start (2 )
3131
3232 with pytest .raises (ValueError , match = "the number of frames must be in range \\ [1; 65535\\ ]" ):
33- _memalloc .start (429496 , 1000 , 1 )
33+ _memalloc .start (429496 , 1 )
3434
3535 with pytest .raises (ValueError , match = "the number of frames must be in range \\ [1; 65535\\ ]" ):
36- _memalloc .start (- 1 , 1000 , 1 )
37-
38- with pytest .raises (ValueError , match = "the number of events must be in range \\ [1; 65535\\ ]" ):
39- _memalloc .start (64 , - 1 , 1 )
36+ _memalloc .start (- 1 , 1 )
4037
4138 with pytest .raises (
4239 ValueError ,
4340 match = "the heap sample size must be in range \\ [0; 4294967295\\ ]" ,
4441 ):
45- _memalloc .start (64 , 1000 , - 1 )
42+ _memalloc .start (64 , - 1 )
4643
4744 with pytest .raises (
4845 ValueError ,
4946 match = "the heap sample size must be in range \\ [0; 4294967295\\ ]" ,
5047 ):
51- _memalloc .start (64 , 1000 , 345678909876 )
48+ _memalloc .start (64 , 345678909876 )
5249
5350
5451def test_start_stop ():
55- _memalloc .start (1 , 1 , 1 )
52+ _memalloc .start (1 , 1 )
5653 _memalloc .stop ()
5754
5855
@@ -69,7 +66,7 @@ def _pre_allocate_1k():
6966
7067def test_iter_events ():
7168 max_nframe = 32
72- collector = memalloc .MemoryCollector (max_nframe = max_nframe , _max_events = 10000 , heap_sample_size = 64 )
69+ collector = memalloc .MemoryCollector (max_nframe = max_nframe , heap_sample_size = 64 )
7370 with collector :
7471 _allocate_1k ()
7572 samples = collector .test_snapshot ()
@@ -105,7 +102,7 @@ def test_iter_events():
105102
106103def test_iter_events_dropped ():
107104 max_nframe = 32
108- collector = memalloc .MemoryCollector (max_nframe = max_nframe , _max_events = 100 , heap_sample_size = 64 )
105+ collector = memalloc .MemoryCollector (max_nframe = max_nframe , heap_sample_size = 64 )
109106 with collector :
110107 _allocate_1k ()
111108 samples = collector .test_snapshot ()
@@ -130,7 +127,7 @@ def test_iter_events_not_started():
130127def test_iter_events_multi_thread ():
131128 max_nframe = 32
132129 t = threading .Thread (target = _allocate_1k )
133- collector = memalloc .MemoryCollector (max_nframe = max_nframe , _max_events = 10000 , heap_sample_size = 64 )
130+ collector = memalloc .MemoryCollector (max_nframe = max_nframe , heap_sample_size = 64 )
134131 with collector :
135132 _allocate_1k ()
136133 t .start ()
@@ -179,7 +176,7 @@ def test_iter_events_multi_thread():
179176
180177def test_heap ():
181178 max_nframe = 32
182- collector = memalloc .MemoryCollector (max_nframe = max_nframe , _max_events = 10000 , heap_sample_size = 1024 )
179+ collector = memalloc .MemoryCollector (max_nframe = max_nframe , heap_sample_size = 1024 )
183180 with collector :
184181 _test_heap_impl (collector , max_nframe )
185182
@@ -298,7 +295,7 @@ def _test_heap_impl(collector, max_nframe):
298295
299296def test_heap_stress ():
300297 # This should run for a few seconds, and is enough to spot potential segfaults.
301- _memalloc .start (64 , 64 , 1024 )
298+ _memalloc .start (64 , 1024 )
302299 try :
303300 x = []
304301
0 commit comments