[pytest-dev] removing assertion reinterpretation and making the assertion rewriter a vendored package

Floris Bruynooghe flub at devork.be
Wed Apr 13 17:58:59 EDT 2016


Hello,

On 13 April 2016 at 13:44, Ronny Pfannschmidt <rpfannsc at redhat.com> wrote:
> currently we still have a monkey-patch in python that causes interesting
> issues in c interaction,
>
> namely the replacement of the Built-in Assertion error by the rewrite module
>
> its highly unlikely we can ever make it act correct, so i propose that
> instead we just remove the assertion re-interpreter

This sounds good to me. We're currently not maintaining that code
properly anyway and it has been 2nd class for a long time. My biggest
worry is that occasionally we still say "disable rewrite" as a
workaround, but there's still plain so that's probably ok.

I assume dropping this is something for 3.0?

> while doing that i'd also like to turn the assertion rewriter into a package
> exposing a minimal api
> that way its releases can be done more in lock with python releases
>
> also its possible for others to use it and contribute to it

This I am less keen on. Most code in the re-write package is very
py.test specific and often bugs about reporting involve code changes
here. We're slowly moving things from py to pytest to avoid this pain
so introducing it here seems counter-intuitive.

I'm not sure which projects do want to use the assert replacing of
py.test. Do you have a use-case in mind?

Lastly, in the life of rewrite we've had just one case where the AST
changed and we failed to keep up. I don't think this is such a heavy
burden and our release process is ever getting better (thanks!) so
should be less of an issue next time.

Regards,
Floris


More information about the pytest-dev mailing list