aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-15 02:12:48 +0200
committerGitHub <noreply@github.com>2019-05-15 02:12:48 +0200
commit5eb8b07f87c66a9ca54fcb90737753ce76a3054d (patch)
tree3bbd691fc50c62d26b388c6ea6306b1e178bbf60 /Programs
parentbpo-36801: Temporarily fix regression in writer.drain() (#13330) (diff)
downloadcpython-5eb8b07f87c66a9ca54fcb90737753ce76a3054d.tar.gz
cpython-5eb8b07f87c66a9ca54fcb90737753ce76a3054d.tar.bz2
cpython-5eb8b07f87c66a9ca54fcb90737753ce76a3054d.zip
bpo-36763: InitConfigTests tests all core config (GH-13331)
Remove UNTESTED_CORE_CONFIG from test_embed.InitConfigTests: all core config fields are now tested! Changes: * Test also dll_path on Windows * Add run_main_config unit test: test config using _Py_RunMain().
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_testembed.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 73b37c5f1f3..2560bfc62bb 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -747,6 +747,27 @@ static int test_run_main(void)
}
+static int test_run_main_config(void)
+{
+ _PyCoreConfig config = _PyCoreConfig_INIT;
+
+ wchar_t *argv[] = {L"python3", L"-c",
+ (L"import _testinternalcapi, json; "
+ L"print(json.dumps(_testinternalcapi.get_configs()))"),
+ L"arg2"};
+ config.argv.length = Py_ARRAY_LENGTH(argv);
+ config.argv.items = argv;
+ config.program_name = L"./python3";
+
+ _PyInitError err = _Py_InitializeFromConfig(&config);
+ if (_Py_INIT_FAILED(err)) {
+ _Py_ExitInitError(err);
+ }
+
+ return _Py_RunMain();
+}
+
+
/* *********************************************************
* List of test cases and the function that implements it.
*
@@ -785,6 +806,7 @@ static struct TestCase TestCases[] = {
{ "preinit_isolated2", test_preinit_isolated2 },
{ "init_read_set", test_init_read_set },
{ "run_main", test_run_main },
+ { "run_main_config", test_run_main_config },
{ NULL, NULL }
};