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: removeTest() method patch for unittest.TestSuite
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: edgimar, eric.araujo, ezio.melotti, iritkatriel, michael.foord
Priority: normal Keywords: patch

Created on 2007-08-21 09:14 by edgimar, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unittest_removetest.patch edgimar, 2007-08-21 09:14 patch to add removeTest method to TestSuite
Messages (9)
msg53044 - (view) Author: Mark Edgington (edgimar) Date: 2007-08-21 09:14
This is a simple patch to add a "removeTest" method to the unittest.TestSuite object.  It is called in exactly the same way the "addTest" method is called, except that it removes the provided TestCase from the suite.

This is useful if you want to add a bunch of unittests via TestLoader().loadTestsFromModule(), EXCEPT for a few specific cases, which you would like to subsequently remove.
msg108206 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-06-19 19:00
This is almost three years old but strikes me as being useful.  Could somebody with more knowledge than myself review the patch and update the relevant Python versions?  Failing that, simply close the issue as not being relevant today.
msg111726 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-27 20:35
As nobody has responded to msg53044 or msg108206 I'll close this unless there are any objections.
msg111732 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-07-27 21:01
Michael, can you say if the feature request is accepted or rejected?
msg111740 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-07-27 22:30
I'm sympathetic to the feature request. I think that the way tests identify themselves will change (improve) to accommodate the new extension machinery. I would like to leave this feature request open for the moment and revisit it again once the extension machinery is in place.
msg180740 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-01-27 03:45
Michael, what's the situation now?
msg181857 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2013-02-10 21:41
I'm pretty sure the proposed patch doesn't work - but there's no test for it so I can't be sure. I can't think of a better basic strategy, but the strategy here is horrible. This means I'm sympathetic to the desire for a removeTest method but not very enthusiastic about implementing it (and certainly not this implementation I'm afraid).
msg181858 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2013-02-10 21:42
I think better filtering at the collection phase - collecting tests by name or filtering out tests by name - could obviate the need for this.
msg406525 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-11-18 09:31
I agree with Michael that it’s better not to include the test in the first place. This issue was abandoned 8 years ago, closing now.
History
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45334
2021-11-18 09:31:51iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg406525

resolution: rejected
stage: resolved
2014-02-03 18:40:28BreamoreBoysetnosy: - BreamoreBoy
2013-02-10 21:42:09michael.foordsetmessages: + msg181858
2013-02-10 21:41:33michael.foordsetmessages: + msg181857
2013-01-27 03:45:50ezio.melottisetnosy: + ezio.melotti

messages: + msg180740
versions: + Python 3.4, - Python 3.2
2010-07-27 22:30:14michael.foordsetmessages: + msg111740
2010-07-27 21:01:15eric.araujosetstatus: pending -> open
versions: + Python 3.2, - Python 3.1, Python 2.7
nosy: + eric.araujo

messages: + msg111732

stage: test needed -> (no value)
2010-07-27 20:35:01BreamoreBoysetstatus: open -> pending

messages: + msg111726
2010-06-19 19:00:38BreamoreBoysetnosy: + BreamoreBoy
messages: + msg108206
2009-04-06 10:58:12ajaksu2setnosy: + michael.foord
versions: + Python 3.1, Python 2.7, - Python 2.5

type: enhancement
stage: test needed
2007-08-21 09:14:46edgimarcreate