mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
bpo-40413: test_embed tests calling Py_RunMain() multiple times (GH-28466)
Calling Py_InitializeFromConfig()+Py_RunMain() multiple times must
not crash.
Cleanup also test_get_argc_argv().
(cherry picked from commit 5e2c32e08e
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
697b6650ed
commit
3d16fc90ce
2 changed files with 24 additions and 4 deletions
|
@ -311,6 +311,14 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
self.assertEqual(out.rstrip(), "Py_RunMain(): sys.argv=['-c', 'arg2']")
|
||||
self.assertEqual(err, '')
|
||||
|
||||
def test_run_main_loop(self):
|
||||
# bpo-40413: Calling Py_InitializeFromConfig()+Py_RunMain() multiple
|
||||
# times must not crash.
|
||||
nloop = 5
|
||||
out, err = self.run_embedded_interpreter("test_run_main_loop")
|
||||
self.assertEqual(out, "Py_RunMain(): sys.argv=['-c', 'arg2']\n" * nloop)
|
||||
self.assertEqual(err, '')
|
||||
|
||||
|
||||
class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
||||
maxDiff = 4096
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue