|  | 
| 24 | 24 | from urllib.request import urlopen, urlcleanup | 
| 25 | 25 | from test.support import import_helper | 
| 26 | 26 | from test.support import os_helper | 
| 27 |  | -from test.support.script_helper import assert_python_ok, assert_python_failure | 
|  | 27 | +from test.support.script_helper import (assert_python_ok, | 
|  | 28 | +                                        assert_python_failure, spawn_python) | 
| 28 | 29 | from test.support import threading_helper | 
| 29 | 30 | from test.support import (reap_children, captured_output, captured_stdout, | 
| 30 | 31 |                           captured_stderr, is_emscripten, is_wasi, | 
| @@ -631,6 +632,14 @@ def test_builtin_on_metaclasses(self): | 
| 631 | 632 |         # Testing that the subclasses section does not appear | 
| 632 | 633 |         self.assertNotIn('Built-in subclasses', text) | 
| 633 | 634 | 
 | 
|  | 635 | +    def test_fail_help_cli(self): | 
|  | 636 | +        elines = (missing_pattern % 'abd').splitlines() | 
|  | 637 | +        with spawn_python("-c" "help()") as proc: | 
|  | 638 | +            out, _ = proc.communicate(b"abd") | 
|  | 639 | +            olines = out.decode().splitlines()[-9:-6] | 
|  | 640 | +            olines[0] = olines[0].removeprefix('help> ') | 
|  | 641 | +            self.assertEqual(elines, olines) | 
|  | 642 | + | 
| 634 | 643 |     def test_fail_help_output_redirect(self): | 
| 635 | 644 |         with StringIO() as buf: | 
| 636 | 645 |             helper = pydoc.Helper(output=buf) | 
|  | 
0 commit comments