-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-subprocessSubprocess issues.Subprocess issues.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Feature or enhancement
Proposal:
make test
my env has a export PYTHONWARNINGS=ignore
make test will fall
FAIL: test_encoding_warning (test.test_subprocess.RunFuncTestCase.test_encoding_warning)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/hyi/prs/cpython/Lib/test/test_subprocess.py", line 1837, in test_encoding_warning
self.assertEqual(len(lines), 2, lines)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 2 : []
at first I thought it is not a big deal
but I checked the code
class Test_TextTestRunner(unittest.TestCase):
"""Tests for TextTestRunner."""
def setUp(self):
# clean the environment from pre-existing PYTHONWARNINGS to make
# test_warnings results consistent
self.pythonwarnings = os.environ.get('PYTHONWARNINGS')
if self.pythonwarnings:
del os.environ['PYTHONWARNINGS']
def tearDown(self):
# bring back pre-existing PYTHONWARNINGS if present
if self.pythonwarnings:
existing code can aviod this.
so I thought it may be can enhance
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-subprocessSubprocess issues.Subprocess issues.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error