]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141612: improve `test_trampoline_works_with_forks` coverage (GH-141613...
authorParesh Joshi <rahulj9223@gmail.com>
Sat, 22 Nov 2025 09:38:34 +0000 (15:08 +0530)
committerGitHub <noreply@github.com>
Sat, 22 Nov 2025 09:38:34 +0000 (10:38 +0100)
* gh-141612: improve `test_trampoline_works_with_forks` coverage (#141613)

(cherry picked from commit f15f6d0ba3715c67643e58959459b0e84a67b183)

Lib/test/test_perf_profiler.py

index b5397c179de0808ff371d9146771e7e0e429ba96..3c845419a3e17438b5e56d719207e0ee08581cf0 100644 (file)
@@ -157,6 +157,16 @@ class TestPerfTrampoline(unittest.TestCase):
         self.assertIn(f"py::bar_fork:{script}", child_perf_file_contents)
         self.assertIn(f"py::baz_fork:{script}", child_perf_file_contents)
 
+        # The parent's map should not contain the child's symbols.
+        self.assertNotIn(f"py::foo_fork:{script}", perf_file_contents)
+        self.assertNotIn(f"py::bar_fork:{script}", perf_file_contents)
+        self.assertNotIn(f"py::baz_fork:{script}", perf_file_contents)
+
+        # The child's map should not contain the parent's symbols.
+        self.assertNotIn(f"py::foo:{script}", child_perf_file_contents)
+        self.assertNotIn(f"py::bar:{script}", child_perf_file_contents)
+        self.assertNotIn(f"py::baz:{script}", child_perf_file_contents)
+
     def test_sys_api(self):
         code = """if 1:
                 import sys