Issue8038
Created on 2010-03-02 13:57 by michael.foord, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| assertNotRegexpMatches.patch | Ryszard.Szopa, 2010-03-08 20:53 | patch with assertNotRegexpMatches. | ||
| Messages (6) | |||
|---|---|---|---|
| msg100291 - (view) | Author: Michael Foord (michael.foord) * ![]() |
Date: 2010-03-02 13:57 | |
Originally reported as a bug against unittest2: http://code.google.com/p/unittest-ext/issues/detail?id=3 There are some assert* methods that don't have their assertNot* counterparts. There's assertDictEqual, assertSequenceEqual, assertRegexpMatches, but no assertDictNotEqual, assertSequenceNotEqual, assertRegexpNotMatches, for example. They should be present for the sake of completeness (I don't like to have to look into the docs to check if a method has a negative counterpart), but also because they ask for a custom output. For example, the error accompanying assertRegexpNotMatches could show the matching part of the text, which is the part that really interests me. assert_(re.match(...)) will only tell me that None is not true... |
|||
| msg100292 - (view) | Author: Michael Foord (michael.foord) * ![]() |
Date: 2010-03-02 14:02 | |
Should there be a 'discussion' stage for the tracker? This isn't *really* at the 'test needed' stage, I'm not 100% convinced we should add all these extra methods just 'for the sake of completeness' - but if they are *needed* they should be added. |
|||
| msg100616 - (view) | Author: Ryszard Szopa (Ryszard.Szopa) | Date: 2010-03-07 23:02 | |
Hi, I am the original reporter of the bug. Please forgive me if this is not the place for discussing the issue. I've thought about it, and stuff like assertDictNotEqual or assertSequenceNotEqual aren't really necessary - it is much easier (and shorter) to use assertNotEqual, and there's no need for any special formatting needed to say that something is equal when it shouldn't. This is not the case for assertNotRegexpMatches, though. assertNot(re.match(...)) tells me only that False is not True. I'd like it to say *how* the text matches the regex (the matching part that is). (Sorry for repeating myself, I try to be clearer this time.) So, this issue could be renamed to "Implement assertNotRegexpMatches." |
|||
| msg100664 - (view) | Author: Ryszard Szopa (Ryszard.Szopa) | Date: 2010-03-08 20:53 | |
Here's the patch against unittest2 that implements assertNotRegexpMatches. |
|||
| msg102211 - (view) | Author: Michael Foord (michael.foord) * ![]() |
Date: 2010-04-02 22:56 | |
Committed revision 79632. |
|||
| msg105313 - (view) | Author: Michael Foord (michael.foord) * ![]() |
Date: 2010-05-08 16:42 | |
Docstrings committed revision 80990. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:58 | admin | set | github: 52286 |
| 2010-05-08 16:42:16 | michael.foord | set | status: open -> closed messages:
+ msg105313 |
| 2010-04-03 01:16:50 | michael.foord | set | messages: - msg102214 |
| 2010-04-03 01:16:31 | michael.foord | set | resolution: accepted messages: + msg102214 |
| 2010-04-02 22:56:17 | michael.foord | set | messages: + msg102211 |
| 2010-03-08 20:53:48 | Ryszard.Szopa | set | files:
+ assertNotRegexpMatches.patch keywords: + patch messages: + msg100664 |
| 2010-03-07 23:15:16 | michael.foord | set | title: Not all the new assert* unittest.TestCase methods have negative (not) equivalents -> Provide unittest.TestCase.assertNotRegexpMatches |
| 2010-03-07 23:02:40 | Ryszard.Szopa | set | nosy:
+ Ryszard.Szopa messages: + msg100616 |
| 2010-03-02 14:02:19 | michael.foord | set | messages: + msg100292 |
| 2010-03-02 14:00:09 | ezio.melotti | set | priority: normal nosy: + ezio.melotti stage: test needed |
| 2010-03-02 13:57:45 | michael.foord | create | |
