]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Fri, 24 Apr 2020 13:51:09 +0000 (16:51 +0300)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2020 13:51:09 +0000 (14:51 +0100)
commit24ffe705c30e36c82940d75fd1454256634d0b3c
tree2efffce48d5a72d5d1e522427d31a0ebd88e36c1
parente6f8abd500751a834b6fff4f107ecbd29f2184fe
bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)

Previously every test was building an extension module and
loading it into sys.modules. The tearDown function was thus
not able to clean up correctly, resulting in memory leaks.

With this commit, every test function now builds the extension
module and runs the actual test code in a new process
(using assert_python_ok), so that sys.modules stays intact
and no memory gets leaked.
Lib/test/test_peg_generator/test_c_parser.py
Tools/peg_generator/pegen/build.py
Tools/peg_generator/pegen/testutil.py