Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_embed.test_pre_initialization_sys_options() env vars #14172

Merged
merged 1 commit into from
Jun 17, 2019
Merged

Fix test_embed.test_pre_initialization_sys_options() env vars #14172

merged 1 commit into from
Jun 17, 2019

Conversation

vstinner
Copy link
Member

test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.

test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting core review labels Jun 17, 2019
@vstinner vstinner merged commit dbdc991 into python:master Jun 17, 2019
@vstinner vstinner deleted the test_embed branch June 17, 2019 22:11
@vstinner
Copy link
Member Author

For the record, this PR fix the following bug:

$ PYTHONWARNINGS=error ./python -m test test_embed -m test_pre_initialization_sys_options -v
== CPython 3.9.0a0 (heads/master-dirty:00f6493084, Jun 17 2019, 21:50:32) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)]
== Linux-5.1.6-300.fc30.x86_64-x86_64-with-glibc2.29 little-endian
== cwd: /home/vstinner/prog/python/master/build/test_python_32058
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.79 [1/1] test_embed
test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) ... FAIL

======================================================================
FAIL: test_pre_initialization_sys_options (test.test_embed.EmbeddingTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_embed.py", line 243, in test_pre_initialization_sys_options
    self.assertIn(expected_output, out)
AssertionError: "sys.warnoptions: ['once', 'module', 'default']\nsys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}\nwarnings.filters[:3]: ['default', 'module', 'once']\n" not found in "Checking PySys_AddWarnOption\nChecking PySys_ResetWarnOptions\nChecking PySys_AddWarnOption linked list\nChecking PySys_AddXOption\nInitializing interpreter\nCheck sys module contents\nFinalizing interpreter\nsys.warnoptions: ['error', 'once', 'module', 'default']\nsys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}\nwarnings.filters[:3]: ['default', 'module', 'once']\n"

----------------------------------------------------------------------

Ran 1 test in 0.069s

FAILED (failures=1)
test test_embed failed
test_embed failed

== Tests result: FAILURE ==

1 test failed:
    test_embed

Total duration: 246 ms
Tests result: FAILURE

@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-14176 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Jun 17, 2019
test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.
(cherry picked from commit dbdc991)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…GH-14172)

test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…GH-14172)

test_pre_initialization_sys_options() of test_embed now removes
PYTHON* environment variables like PYTHONWARNINGS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants