summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-12-08 07:38:16 (GMT)
committerGitHub <noreply@github.com>2019-12-08 07:38:16 (GMT)
commit6cac1136665b70f72db291b95876d7affcf1d2db (patch)
treebaf9af65677cacb92ec5d10d8567e90bf8246b17 /Lib/test/support
parent2b7de6696bf2f924cd2cd9ff0a539c8aa37c6244 (diff)
downloadcpython-6cac1136665b70f72db291b95876d7affcf1d2db.zip
cpython-6cac1136665b70f72db291b95876d7affcf1d2db.tar.gz
cpython-6cac1136665b70f72db291b95876d7affcf1d2db.tar.bz2
bpo-38991: Remove test.support.strip_python_stderr() (GH-17490)
test.support: run_python_until_end(), assert_python_ok() and assert_python_failure() functions no longer strip whitespaces from stderr.
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py10
-rw-r--r--Lib/test/support/script_helper.py3
2 files changed, 1 insertions, 12 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 7e1b30c..215bab8 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2512,16 +2512,6 @@ def swap_item(obj, item, new_val):
if item in obj:
del obj[item]
-def strip_python_stderr(stderr):
- """Strip the stderr of a Python process from potential debug output
- emitted by the interpreter.
-
- This will typically be run on the result of the communicate() method
- of a subprocess.Popen object.
- """
- stderr = re.sub(br"\[\d+ refs, \d+ blocks\]\r?\n?", b"", stderr).strip()
- return stderr
-
requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
'types are immortal if COUNT_ALLOCS is defined')
diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py
index 8351998..37e576d 100644
--- a/Lib/test/support/script_helper.py
+++ b/Lib/test/support/script_helper.py
@@ -11,7 +11,7 @@ import py_compile
import zipfile
from importlib.util import source_from_cache
-from test.support import make_legacy_pyc, strip_python_stderr
+from test.support import make_legacy_pyc
# Cached result of the expensive test performed in the function below.
@@ -134,7 +134,6 @@ def run_python_until_end(*args, **env_vars):
proc.kill()
subprocess._cleanup()
rc = proc.returncode
- err = strip_python_stderr(err)
return _PythonRunResult(rc, out, err), cmd_line
def _assert_python(expected_success, /, *args, **env_vars):