from urllib.request import urlopen, urlcleanup
from test.support import import_helper
from test.support import os_helper
-from test.support.script_helper import assert_python_ok, assert_python_failure
+from test.support.script_helper import (assert_python_ok,
+ assert_python_failure, spawn_python)
from test.support import threading_helper
from test.support import (reap_children, captured_output, captured_stdout,
captured_stderr, is_emscripten, is_wasi,
# Testing that the subclasses section does not appear
self.assertNotIn('Built-in subclasses', text)
+ def test_fail_help_cli(self):
+ elines = (missing_pattern % 'abd').splitlines()
+ with spawn_python("-c" "help()") as proc:
+ out, _ = proc.communicate(b"abd")
+ olines = out.decode().splitlines()[-9:-6]
+ olines[0] = olines[0].removeprefix('help> ')
+ self.assertEqual(elines, olines)
+
def test_fail_help_output_redirect(self):
with StringIO() as buf:
helper = pydoc.Helper(output=buf)