@@ -434,6 +434,7 @@ def test_cli_default_collapsed_filename(self):
434434
435435 with (
436436 mock .patch ("sys.argv" , test_args ),
437+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
437438 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
438439 ):
439440 from profiling .sampling .cli import main
@@ -476,6 +477,7 @@ def test_cli_custom_output_filenames(self):
476477 for test_args , expected_filename , expected_format in test_cases :
477478 with (
478479 mock .patch ("sys.argv" , test_args ),
480+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
479481 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
480482 ):
481483 main ()
@@ -516,6 +518,7 @@ def test_argument_parsing_basic(self):
516518
517519 with (
518520 mock .patch ("sys.argv" , test_args ),
521+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
519522 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
520523 ):
521524 from profiling .sampling .cli import main
@@ -540,6 +543,7 @@ def test_sort_options(self):
540543
541544 with (
542545 mock .patch ("sys.argv" , test_args ),
546+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
543547 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
544548 ):
545549 from profiling .sampling .cli import main
@@ -554,6 +558,7 @@ def test_async_aware_flag_defaults_to_running(self):
554558
555559 with (
556560 mock .patch ("sys.argv" , test_args ),
561+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
557562 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
558563 ):
559564 from profiling .sampling .cli import main
@@ -570,6 +575,7 @@ def test_async_aware_with_async_mode_all(self):
570575
571576 with (
572577 mock .patch ("sys.argv" , test_args ),
578+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
573579 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
574580 ):
575581 from profiling .sampling .cli import main
@@ -585,6 +591,7 @@ def test_async_aware_default_is_none(self):
585591
586592 with (
587593 mock .patch ("sys.argv" , test_args ),
594+ mock .patch ("profiling.sampling.sample._is_process_running" , return_value = True ),
588595 mock .patch ("profiling.sampling.cli.sample" ) as mock_sample ,
589596 ):
590597 from profiling .sampling .cli import main
0 commit comments