This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add method to get user defined command line arguments in unittest.main
Type: Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: remi.lapeyre
Priority: normal Keywords: patch

Created on 2019-02-19 13:06 by remi.lapeyre, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
0001-WIP.patch remi.lapeyre, 2019-02-19 13:06
Messages (1)
msg335944 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-02-19 13:06
Hi, I'm working on issue 18765 (running pdb.post_mortem() on failing test cases) where I need to control the behavior of a TestCase based on some outside input.

For this issue, I want to add a new --pdb option to turn this feature on when enabled. As of today, it seems to me that the command line arguments given to the TestProgram are not accessible from the TestCase.

Would adding a new parameter to TestCase be breaking backward compatibility? If so, what would be a better way to access command line arguments from TestCase?



In addition to this, I have the need for another project to change the behavior of TestCases based on a custom command line argument. I propose to add a new method `getCustomArguments` that will take the parser as input so the user can define it's own arguments by subclassing TestProgram

What do you think about this?
History
Date User Action Args
2022-04-11 14:59:11adminsetgithub: 80217
2019-02-19 13:06:29remi.lapeyresetcomponents: + Library (Lib)
versions: + Python 3.8
2019-02-19 13:06:20remi.lapeyrecreate