diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-07-10 21:03:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 21:03:32 (GMT) |
commit | 68ca19061d19345a72574a6c3849981213de212b (patch) | |
tree | 1a5ec47a7b7c2a6b5ab8f6776aef0ef6bca11812 /Python/sysmodule.c | |
parent | 2da967ea14a49d1ca3e2d22d83ce9f6ffd5e6186 (diff) | |
download | cpython-68ca19061d19345a72574a6c3849981213de212b.zip cpython-68ca19061d19345a72574a6c3849981213de212b.tar.gz cpython-68ca19061d19345a72574a6c3849981213de212b.tar.bz2 |
[3.12] gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196) (#106605)
gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196)
Reduce test noise by fixing or catching and testing stderr messages from individual tests.
test_cmd_line_script.test_script_as_dev_fd calls spawn_python and hence subprocess.Popen with incompatible arguments. On POSIX, pass_fds forces close_fds to be True (subprocess.py line 848). Correct the call.
test_uuid.test_cli_namespace_required_for_uuid3: when the namespace is omitted, uuid.main calls argparse.Argument_Parser.error, which prints to stderr before calling sys.exit, which raises SystemExit. Unittest assertRaises catches the exception but not the previous output. Catch the output and test it.
test_warnings.test_catchwarnings_with_simplefilter_error similarly prints before raising. Catch the output and test it.
---------
(cherry picked from commit 9d582250d8fde240b8e7299b74ba888c574f74a3)
Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions