Skip to content

bpo-22859: deprecating unittest.TestProgram.usageExit #30293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/unittest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import argparse
import os
import warnings

from . import loader, runner
from .signals import installHandler
Expand Down Expand Up @@ -101,6 +102,8 @@ def __init__(self, module='__main__', defaultTest=None, argv=None,
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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:meth:`~unittest.TestProgram.usageExit` is marked deprecated, to be removed in 3.13.