]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293)
authorCarlos Damazio <carlos.damazio@damazio.dev>
Thu, 17 Mar 2022 02:41:02 +0000 (23:41 -0300)
committerGitHub <noreply@github.com>
Thu, 17 Mar 2022 02:41:02 +0000 (19:41 -0700)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Lib/unittest/main.py
Misc/NEWS.d/next/Library/2021-12-29-19-37-49.bpo-22859.AixHW7.rst [new file with mode: 0644]

index e62469aa2a170f2bc1894adc232cf46cdeb2b4d9..cb8f1f302801dc0ffda14daf0ad51f7b85b4de18 100644 (file)
@@ -3,6 +3,7 @@
 import sys
 import argparse
 import os
+import warnings
 
 from . import loader, runner
 from .signals import installHandler
@@ -101,6 +102,8 @@ class TestProgram(object):
         self.runTests()
 
     def usageExit(self, msg=None):
+        warnings.warn("TestProgram.usageExit() is deprecated and will be"
+                      " removed in Python 3.13", DeprecationWarning)
         if msg:
             print(msg)
         if self._discovery_parser is None:
diff --git a/Misc/NEWS.d/next/Library/2021-12-29-19-37-49.bpo-22859.AixHW7.rst b/Misc/NEWS.d/next/Library/2021-12-29-19-37-49.bpo-22859.AixHW7.rst
new file mode 100644 (file)
index 0000000..f6380b0
--- /dev/null
@@ -0,0 +1 @@
+:meth:`~unittest.TestProgram.usageExit` is marked deprecated, to be removed in 3.13.