[Python-Dev] cpython: #20145: assert[Raises|Warns]Regex now raise TypeError on bad regex.

Terry Reedy tjreedy at udel.edu
Mon Mar 24 01:58:21 CET 2014


On 3/23/2014 7:47 PM, Antoine Pitrou wrote:
> On Sun, 23 Mar 2014 19:44:42 -0400
> "R. David Murray" <rdmurray at bitdance.com> wrote:
>
>> On Sun, 23 Mar 2014 21:43:14 +0100, Antoine Pitrou <solipsis at pitrou.net> wrote:
>>> On Sun, 23 Mar 2014 20:47:28 +0100 (CET)
>>> r.david.murray <python-checkins at python.org> wrote:
...
>>>> Previously a non-string, non-regex second argument could cause the test
>>>> to always pass.
>>>
>>> It seems like this would be useful to fix in 3.4 too.
>>
>> You will note that the change got a porting note in What's New.  It will
>> only break tests (that are currently no-ops), not code, so I'd be fine
>> with backporting it, but the original issue did not call for that.
>
> Exposing buggy tests sounds like a good thing to me :-)
>
>> If we fix it in 3.4, should we fix it in 2.7 as well?
>
> If the *Regex methods are there, yes, IMO.

I agree. Since I and others am writing tests for all current versions of 
Idle, I would like a buggy test to fail no matter where it is first 
tested. Currently, I would tend to start with 3.4.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list