[pytest-dev] Fwd: Continuing on failures
m at maximilianroos.com
Thu Mar 26 18:29:16 EDT 2020
To prefix: as a long time user and evangelizer of pytest, a big thank you
for the superb tool.
I wanted to build a tool that replaces incorrect values in tests with
correct values, similar to frameworks like rust's insta
<https://github.com/mitsuhiko/insta> or ocaml's ppx_expect
<https://github.com/janestreet/ppx_expect>, but ideally in the pytest
spirit of retaining the use of `assert` rather than a custom function. I
built a PoC <https://github.com/max-sixty/pytest-accept> that successfully
replaces the *first* error in a test with the correct value.
As per that README, it only works on the first failure, because the test
doesn't continue execution beyond that. *Is there any way of allowing
execution to continue, without ripping up the internals of pytest?* My
prior is "no", since the assertion rewrite still retains an assertion, and
there's no hook for changing that.
Ref: a similar question I asked @okken
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pytest-dev