[PATCH] tests: fix assertion rewriting in some tests with pytest-3.0.0+

Thomas De Schampheleire patrickdepinguin at gmail.com
Fri Sep 9 16:38:48 UTC 2016


On Sep 9, 2016 4:21 PM, "Mads Kiilerich" <mads at kiilerich.com> wrote:
>
> On 09/09/2016 04:03 PM, Thomas De Schampheleire wrote:
>>
>> # HG changeset patch
>> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
>> # Date 1473428048 -7200
>> #      Fri Sep 09 15:34:08 2016 +0200
>> # Node ID 6889d3b7435f1c4bb91d24a3af7774323ecbc778
>> # Parent  59639343672495cb89be54b98f1d6d3a4c44307c
>> tests: fix assertion rewriting in some tests with pytest-3.0.0+
>
>
> Thanks ... but that fails with pytest < 3.
>
> I can wrap it with
> if getattr(pytest, 'register_assert_rewrite', None):

I guess there is also a version variable/method in pytest that we can use.
If later the method is renamed, it won't go unnoticed...

> ... or we could desupport pytest < 3. But I guess this shows that it can
be convenient to keep the old version around a bit.

I would rather argue that it is better to support a single version, then
this mistake could not have happened...
Especially for testing/development tools I don't see a reason to support
multiple ones.

/Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20160909/07c4f776/attachment.html>


More information about the kallithea-general mailing list