[Python-checkins] bpo-46877: export unittest.doModuleCleanups in unittest package (#31613)
gvanrossum
webhook-mailer at python.org
Thu Mar 3 13:41:58 EST 2022
https://github.com/python/cpython/commit/cc400585fab02994255f21ae8183d5f147236815
commit: cc400585fab02994255f21ae8183d5f147236815
branch: main
author: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2022-03-03T10:41:28-08:00
summary:
bpo-46877: export unittest.doModuleCleanups in unittest package (#31613)
files:
A Misc/NEWS.d/next/Library/2022-03-03-06-58-52.bpo-46877.BKgjpD.rst
M Lib/unittest/__init__.py
diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py
index 4b184889573940..eda951ce73e665 100644
--- a/Lib/unittest/__init__.py
+++ b/Lib/unittest/__init__.py
@@ -49,7 +49,7 @@ def testMultiply(self):
'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
'expectedFailure', 'TextTestResult', 'installHandler',
'registerResult', 'removeResult', 'removeHandler',
- 'addModuleCleanup']
+ 'addModuleCleanup', 'doModuleCleanups']
# Expose obsolete functions for backwards compatibility
# bpo-5846: Deprecated in Python 3.11, scheduled for removal in Python 3.13.
@@ -59,7 +59,7 @@ def testMultiply(self):
from .result import TestResult
from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip,
- skipIf, skipUnless, expectedFailure)
+ skipIf, skipUnless, expectedFailure, doModuleCleanups)
from .suite import BaseTestSuite, TestSuite
from .loader import TestLoader, defaultTestLoader
from .main import TestProgram, main
diff --git a/Misc/NEWS.d/next/Library/2022-03-03-06-58-52.bpo-46877.BKgjpD.rst b/Misc/NEWS.d/next/Library/2022-03-03-06-58-52.bpo-46877.BKgjpD.rst
new file mode 100644
index 00000000000000..6738519377f4ad
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-03-03-06-58-52.bpo-46877.BKgjpD.rst
@@ -0,0 +1 @@
+Export :func:`unittest.doModuleCleanups` in :mod:`unittest`. Patch by Kumar Aditya.
More information about the Python-checkins
mailing list