]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46877: export unittest.doModuleCleanups in unittest package (#31613)
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Thu, 3 Mar 2022 18:41:28 +0000 (00:11 +0530)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 18:41:28 +0000 (10:41 -0800)
Lib/unittest/__init__.py
Misc/NEWS.d/next/Library/2022-03-03-06-58-52.bpo-46877.BKgjpD.rst [new file with mode: 0644]

index 4b184889573940199333cf981d78a4949fe86568..eda951ce73e66592e081a9eba8e556e4bacfed87 100644 (file)
@@ -49,7 +49,7 @@ __all__ = ['TestResult', 'TestCase', 'IsolatedAsyncioTestCase', 'TestSuite',
            '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 @@ __unittest = True
 
 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 (file)
index 0000000..6738519
--- /dev/null
@@ -0,0 +1 @@
+Export :func:`unittest.doModuleCleanups` in :mod:`unittest`. Patch by Kumar Aditya.