Vitalije, This looks nice. I'm really impressed with the assertion failure output pytest gives.
I wonder how hard it would be to write a pytest plugin to support leo's unit tests. Their plugin system makes use of hooks like Leo does, only it is like hooks on steroids. This example code shows how tests can be collected from a yaml file instead of python code: https://docs.pytest.org/en/latest/example/nonpython.html#yaml-plugin. Writing code to get tests from unittest.leo might be similarly straightforward. https://docs.pytest.org/en/latest/writing_plugins.html https://docs.pytest.org/en/latest/plugins.html#using-plugins https://docs.pytest.org/en/latest/reference.html#collection-hooks https://pluggy.readthedocs.io/en/latest/ That's quite an impressive plugin system pytest has. Brian On Thu, Sep 26, 2019 at 6:31 AM vitalije <[email protected]> wrote: > Hm, looking in the output it seems that the name of the test node, and > failed test function in the output are missed. Revision 064e218 > <http://064e218b75dc2f90d0fb53317fb34895750a8a91> fixes this. Now the > output is like: > > -------example/test_a failed--------- > assert 4 == 4.1 > + where 4 = inc(3) > -------example/test_b failed--------- > assert 18.299999999999997 == 18 > + where 18.299999999999997 = times_3(6.1) > + where 6.1 = add_2(4.1) > + where 4.1 = inc(3.1) > + and 18 = times_3(6) > + where 6 = inc(5) > failed:2 tests > > Vitalije > > -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/leo-editor/b7880eb4-9c2f-4d37-932d-d1f0d72fcfe3%40googlegroups.com > <https://groups.google.com/d/msgid/leo-editor/b7880eb4-9c2f-4d37-932d-d1f0d72fcfe3%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAO5X8Cx6ygFDRqGgXgb%2BmPnFM5Ow34qWr41Y%3DS0rgdcjT7ksmw%40mail.gmail.com.
