Skip to content

Commit 7c353b7

Browse files
Carlos Damaziokumaraditya303JelleZijlstra
authored
bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293)
Co-authored-by: Kumar Aditya <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 30b5d41 commit 7c353b7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/unittest/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import argparse
55
import os
6+
import warnings
67

78
from . import loader, runner
89
from .signals import installHandler
@@ -101,6 +102,8 @@ def __init__(self, module='__main__', defaultTest=None, argv=None,
101102
self.runTests()
102103

103104
def usageExit(self, msg=None):
105+
warnings.warn("TestProgram.usageExit() is deprecated and will be"
106+
" removed in Python 3.13", DeprecationWarning)
104107
if msg:
105108
print(msg)
106109
if self._discovery_parser is None:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:meth:`~unittest.TestProgram.usageExit` is marked deprecated, to be removed in 3.13.

0 commit comments

Comments
 (0)