[3.13] gh-141612: improve test_trampoline_works_with_forks coverage (GH-141613) (#141826)

* gh-141612: improve `test_trampoline_works_with_forks` coverage (#141613)

(cherry picked from commit f15f6d0ba3)
This commit is contained in:
Paresh Joshi 2025-11-22 15:08:34 +05:30 committed by GitHub
parent af94f62bf6
commit de44d71605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,6 +157,16 @@ def baz():
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