]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45046: Support context managers in unittest (GH-28045)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 8 May 2022 15:12:19 +0000 (08:12 -0700)
committerGitHub <noreply@github.com>
Sun, 8 May 2022 15:12:19 +0000 (08:12 -0700)
commitc63c8ac2389d715c761f56bfcf17a685b62a0bd3
tree5b4e82a1f54099f9a75217ac0045aa071dcf4188
parenta85bdd7e025f8b87b88d914f4df8f0b620398ea9
bpo-45046: Support context managers in unittest (GH-28045)

Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().
(cherry picked from commit 086c6b1b0fe8d47ebd15512d7bdcb64c60a360f0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
26 files changed:
Doc/library/unittest.rst
Doc/whatsnew/3.11.rst
Lib/distutils/tests/test_build_ext.py
Lib/test/test__osx_support.py
Lib/test/test_argparse.py
Lib/test/test_getopt.py
Lib/test/test_gettext.py
Lib/test/test_global.py
Lib/test/test_importlib/source/test_finder.py
Lib/test/test_importlib/test_namespace_pkgs.py
Lib/test/test_logging.py
Lib/test/test_nntplib.py
Lib/test/test_peg_generator/test_c_parser.py
Lib/test/test_poll.py
Lib/test/test_posix.py
Lib/test/test_set.py
Lib/test/test_socket.py
Lib/test/test_ssl.py
Lib/test/test_tempfile.py
Lib/test/test_urllib.py
Lib/unittest/__init__.py
Lib/unittest/async_case.py
Lib/unittest/case.py
Lib/unittest/test/test_async_case.py
Lib/unittest/test/test_runner.py
Misc/NEWS.d/next/Library/2021-08-29-19-59-16.bpo-45046.eGq0NC.rst [new file with mode: 0644]