bpo-36301: Test Python init with isolated (GH-12569)

Add test_preinit_isolated1() and test_preinit_isolated2() test_embed.
This commit is contained in:
Victor Stinner 2019-03-27 00:26:18 +01:00 committed by GitHub
parent 6cd658b1a5
commit 6da20a4950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 90 additions and 0 deletions

View file

@ -662,6 +662,26 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
}
self.check_config("init_isolated", config, preconfig)
def test_preinit_isolated1(self):
# _PyPreConfig.isolated=1, _PyCoreConfig.isolated not set
preconfig = {}
config = {
'isolated': 1,
'use_environment': 0,
'user_site_directory': 0,
}
self.check_config("preinit_isolated1", config, preconfig)
def test_preinit_isolated2(self):
# _PyPreConfig.isolated=0, _PyCoreConfig.isolated=1
preconfig = {}
config = {
'isolated': 1,
'use_environment': 0,
'user_site_directory': 0,
}
self.check_config("preinit_isolated2", config, preconfig)
if __name__ == "__main__":
unittest.main()