Before the argparse migration usageExit was invoked and could be extended via subclasses, but it no longer is. We could delete it (and document it being no longer accessible) or put some glue in to reinstate it. I think deleting it is fine, as long as we make the argparse parser objects part of the API (so that folk have a reliable place to poke at to change help).
Activity
rbtcollins commented on Nov 13, 2014
Before the argparse migration usageExit was invoked and could be extended via subclasses, but it no longer is. We could delete it (and document it being no longer accessible) or put some glue in to reinstate it. I think deleting it is fine, as long as we make the argparse parser objects part of the API (so that folk have a reliable place to poke at to change help).
carlosdamazio commented on Dec 29, 2021
Well, to this issue, I'm going to put a PR to remove it and give it a chance for it to being reinstated if you folks want to.
JelleZijlstra commented on Jan 24, 2022
I suggest we mark the method as deprecated and remove it in 3.13.
Making the argparse objects public can be done in a separate enhancement request if there is demand for it.
JelleZijlstra commented on Mar 17, 2022
New changeset 7c353b7 by Carlos Damazio in branch 'main':
bpo-22859: deprecate unittest.main.TestProgram.usageExit (GH-30293)
7c353b7
JelleZijlstra commented on Mar 17, 2022
It is now marked deprecated, to be removed in 3.13.
hugovk commented on May 26, 2023
Please see #104992 to remove it in 3.13.