@@ -207,7 +207,9 @@ def test_process_remote_default():
207207 locals = False ,
208208 method = StackMethod .AUTO ,
209209 )
210- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
210+ assert print_thread_mock .mock_calls == [
211+ call (thread , NativeReportingMode .OFF ) for thread in threads
212+ ]
211213
212214
213215def test_process_remote_no_block ():
@@ -238,13 +240,23 @@ def test_process_remote_no_block():
238240 locals = False ,
239241 method = StackMethod .AUTO ,
240242 )
241- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
243+ assert print_thread_mock .mock_calls == [
244+ call (thread , NativeReportingMode .OFF ) for thread in threads
245+ ]
242246
243247
244- def test_process_remote_native ():
248+ @pytest .mark .parametrize (
249+ "argument, mode" ,
250+ [
251+ ["--native" , NativeReportingMode .PYTHON ],
252+ ["--native-all" , NativeReportingMode .ALL ],
253+ ["--native-last" , NativeReportingMode .LAST ],
254+ ],
255+ )
256+ def test_process_remote_native (argument , mode ):
245257 # GIVEN
246258
247- argv = ["pystack" , "remote" , "31" , "--native" ]
259+ argv = ["pystack" , "remote" , "31" , argument ]
248260
249261 threads = [Mock (), Mock (), Mock ()]
250262
@@ -265,11 +277,11 @@ def test_process_remote_native():
265277 get_process_threads_mock .assert_called_with (
266278 31 ,
267279 stop_process = True ,
268- native_mode = NativeReportingMode . PYTHON ,
280+ native_mode = mode ,
269281 locals = False ,
270282 method = StackMethod .AUTO ,
271283 )
272- assert print_thread_mock .mock_calls == [call (thread , True ) for thread in threads ]
284+ assert print_thread_mock .mock_calls == [call (thread , mode ) for thread in threads ]
273285
274286
275287def test_process_remote_locals ():
@@ -300,7 +312,9 @@ def test_process_remote_locals():
300312 locals = True ,
301313 method = StackMethod .AUTO ,
302314 )
303- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
315+ assert print_thread_mock .mock_calls == [
316+ call (thread , NativeReportingMode .OFF ) for thread in threads
317+ ]
304318
305319
306320def test_process_remote_native_no_block (capsys ):
@@ -357,7 +371,9 @@ def test_process_remote_exhaustive():
357371 locals = False ,
358372 method = StackMethod .ALL ,
359373 )
360- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
374+ assert print_thread_mock .mock_calls == [
375+ call (thread , NativeReportingMode .OFF ) for thread in threads
376+ ]
361377
362378
363379@pytest .mark .parametrize (
@@ -432,7 +448,9 @@ def test_process_core_default_without_executable():
432448 locals = False ,
433449 method = StackMethod .AUTO ,
434450 )
435- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
451+ assert print_thread_mock .mock_calls == [
452+ call (thread , NativeReportingMode .OFF ) for thread in threads
453+ ]
436454
437455
438456def test_process_core_default_gzip_without_executable ():
@@ -486,7 +504,9 @@ def test_process_core_default_gzip_without_executable():
486504 locals = False ,
487505 method = StackMethod .AUTO ,
488506 )
489- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
507+ assert print_thread_mock .mock_calls == [
508+ call (thread , NativeReportingMode .OFF ) for thread in threads
509+ ]
490510 gzip_open_mock .assert_called_with (Path ("corefile.gz" ), "rb" )
491511
492512
@@ -580,14 +600,17 @@ def test_process_core_default_with_executable():
580600 locals = False ,
581601 method = StackMethod .AUTO ,
582602 )
583- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
603+ assert print_thread_mock .mock_calls == [
604+ call (thread , NativeReportingMode .OFF ) for thread in threads
605+ ]
584606
585607
586608@pytest .mark .parametrize (
587609 "argument, mode" ,
588610 [
589611 ["--native" , NativeReportingMode .PYTHON ],
590612 ["--native-all" , NativeReportingMode .ALL ],
613+ ["--native-last" , NativeReportingMode .LAST ],
591614 ],
592615)
593616def test_process_core_native (argument , mode ):
@@ -627,7 +650,7 @@ def test_process_core_native(argument, mode):
627650 locals = False ,
628651 method = StackMethod .AUTO ,
629652 )
630- assert print_thread_mock .mock_calls == [call (thread , True ) for thread in threads ]
653+ assert print_thread_mock .mock_calls == [call (thread , mode ) for thread in threads ]
631654
632655
633656def test_process_core_locals ():
@@ -667,7 +690,9 @@ def test_process_core_locals():
667690 locals = True ,
668691 method = StackMethod .AUTO ,
669692 )
670- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
693+ assert print_thread_mock .mock_calls == [
694+ call (thread , NativeReportingMode .OFF ) for thread in threads
695+ ]
671696
672697
673698def test_process_core_with_search_path ():
@@ -714,7 +739,9 @@ def test_process_core_with_search_path():
714739 locals = False ,
715740 method = StackMethod .AUTO ,
716741 )
717- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
742+ assert print_thread_mock .mock_calls == [
743+ call (thread , NativeReportingMode .OFF ) for thread in threads
744+ ]
718745
719746
720747def test_process_core_with_search_root ():
@@ -762,7 +789,9 @@ def test_process_core_with_search_root():
762789 locals = False ,
763790 method = StackMethod .AUTO ,
764791 )
765- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
792+ assert print_thread_mock .mock_calls == [
793+ call (thread , NativeReportingMode .OFF ) for thread in threads
794+ ]
766795
767796
768797def test_process_core_with_not_readable_search_root ():
@@ -947,7 +976,9 @@ def test_process_core_exhaustive():
947976 locals = False ,
948977 method = StackMethod .ALL ,
949978 )
950- assert print_thread_mock .mock_calls == [call (thread , False ) for thread in threads ]
979+ assert print_thread_mock .mock_calls == [
980+ call (thread , NativeReportingMode .OFF ) for thread in threads
981+ ]
951982
952983
953984def test_default_colored_output ():
0 commit comments