1- """Tests for --children subprocess profiling support."""
1+ """Tests for --subprocesses subprocess profiling support."""
22
33import argparse
44import io
@@ -334,36 +334,36 @@ def test_context_manager(self):
334334@skip_if_not_supported
335335@requires_subprocess ()
336336class TestCLIChildrenFlag (unittest .TestCase ):
337- """Tests for the --children CLI flag."""
337+ """Tests for the --subprocesses CLI flag."""
338338
339339 def setUp (self ):
340340 reap_children ()
341341
342342 def tearDown (self ):
343343 reap_children ()
344344
345- def test_children_flag_parsed (self ):
346- """Test that --children flag is recognized."""
345+ def test_subprocesses_flag_parsed (self ):
346+ """Test that --subprocesses flag is recognized."""
347347 from profiling .sampling .cli import _add_sampling_options
348348
349349 parser = argparse .ArgumentParser ()
350350 _add_sampling_options (parser )
351351
352- # Parse with --children
353- args = parser .parse_args (["--children " ])
354- self .assertTrue (args .children )
352+ # Parse with --subprocesses
353+ args = parser .parse_args (["--subprocesses " ])
354+ self .assertTrue (args .subprocesses )
355355
356- # Parse without --children
356+ # Parse without --subprocesses
357357 args = parser .parse_args ([])
358- self .assertFalse (args .children )
358+ self .assertFalse (args .subprocesses )
359359
360- def test_children_incompatible_with_live (self ):
361- """Test that --children is incompatible with --live."""
360+ def test_subprocesses_incompatible_with_live (self ):
361+ """Test that --subprocesses is incompatible with --live."""
362362 from profiling .sampling .cli import _validate_args
363363
364- # Create mock args with both children and live
364+ # Create mock args with both subprocesses and live
365365 args = argparse .Namespace (
366- children = True ,
366+ subprocesses = True ,
367367 live = True ,
368368 async_aware = False ,
369369 format = "pstats" ,
@@ -500,7 +500,7 @@ def test_build_output_pattern_default(self):
500500 "Test requires process_vm_readv support on Linux" ,
501501)
502502class TestChildrenIntegration (unittest .TestCase ):
503- """Integration tests for --children functionality."""
503+ """Integration tests for --subprocesses functionality."""
504504
505505 def setUp (self ):
506506 reap_children ()
@@ -891,16 +891,16 @@ def test_wait_for_profilers_multiple(self):
891891 "Test requires process_vm_readv support on Linux" ,
892892)
893893class TestEndToEndChildrenCLI (unittest .TestCase ):
894- """End-to-end tests for --children CLI flag."""
894+ """End-to-end tests for --subprocesses CLI flag."""
895895
896896 def setUp (self ):
897897 reap_children ()
898898
899899 def tearDown (self ):
900900 reap_children ()
901901
902- def test_children_flag_spawns_child_and_creates_output (self ):
903- """Test that --children flag works end-to-end with actual subprocesses."""
902+ def test_subprocesses_flag_spawns_child_and_creates_output (self ):
903+ """Test that --subprocesses flag works end-to-end with actual subprocesses."""
904904 # Create a temporary directory for output files
905905 with tempfile .TemporaryDirectory () as tmpdir :
906906 # Create a script that spawns a child Python process
@@ -926,14 +926,14 @@ def test_children_flag_spawns_child_and_creates_output(self):
926926
927927 output_file = os .path .join (tmpdir , "profile.pstats" )
928928
929- # Run the profiler with --children flag
929+ # Run the profiler with --subprocesses flag
930930 result = subprocess .run (
931931 [
932932 sys .executable ,
933933 "-m" ,
934934 "profiling.sampling" ,
935935 "run" ,
936- "--children " ,
936+ "--subprocesses " ,
937937 "-d" ,
938938 "3" ,
939939 "-i" ,
@@ -971,8 +971,8 @@ def test_children_flag_spawns_child_and_creates_output(self):
971971 f"stdout: { result .stdout } , stderr: { result .stderr } "
972972 )
973973
974- def test_children_flag_with_flamegraph_output (self ):
975- """Test --children with flamegraph output format."""
974+ def test_subprocesses_flag_with_flamegraph_output (self ):
975+ """Test --subprocesses with flamegraph output format."""
976976 with tempfile .TemporaryDirectory () as tmpdir :
977977 # Simple parent that spawns a child
978978 parent_script = f"""
@@ -995,7 +995,7 @@ def test_children_flag_with_flamegraph_output(self):
995995 "-m" ,
996996 "profiling.sampling" ,
997997 "run" ,
998- "--children " ,
998+ "--subprocesses " ,
999999 "-d" ,
10001000 "2" ,
10011001 "-i" ,
@@ -1024,8 +1024,8 @@ def test_children_flag_with_flamegraph_output(self):
10241024 "Flamegraph output should be HTML" ,
10251025 )
10261026
1027- def test_children_flag_no_crash_on_quick_child (self ):
1028- """Test that --children doesn't crash when child exits quickly."""
1027+ def test_subprocesses_flag_no_crash_on_quick_child (self ):
1028+ """Test that --subprocesses doesn't crash when child exits quickly."""
10291029 with tempfile .TemporaryDirectory () as tmpdir :
10301030 # Parent spawns a child that exits immediately
10311031 parent_script = f"""
@@ -1049,7 +1049,7 @@ def test_children_flag_no_crash_on_quick_child(self):
10491049 "-m" ,
10501050 "profiling.sampling" ,
10511051 "run" ,
1052- "--children " ,
1052+ "--subprocesses " ,
10531053 "-d" ,
10541054 "2" ,
10551055 "-i" ,
0 commit comments