On Sun, Dec 29, 2019 at 5:54 PM Edward K. Ream <edream...@gmail.com> wrote:
> On Sun, Dec 29, 2019 at 5:29 PM Brian Theado <brian.the...@gmail.com> > wrote: > [...] > > You might also find the code coverage report useful: > > Yes, that's interesting. The TOG classes remember which visitors have > been visited, so that's probably enough. > It still think full line-by-line coverage analysis will be very valuable. I ran it like this: pip install pytest-cov pytest --cov-report html --cov-report term-missing --cov=leo.core.leoAst leo/core/leoAst.py firefox htmlcov/leo_core_leoAst_py.html ;# Or whatever your web browser is It shows only 52% coverage, but maybe there is a lot more to that file which you don't want to test? The TOG class looks to have a higher percentage of the code covered than that, but there are still plenty of gaps. Maybe you aren't viewing the your visitor report or have not yet prioritized adding tests for all the visitors, but here is a partial list of completely untested methods: sync_newline do_AsyncFunctionDef do_Interactive do_Expression do_Constant do_ExtSlice do_Set do_SetComp Even in the methods which are tested, there are some interesting-looking branches of code not tested. Here are some examples: 1. do_Keyword, the if node.arg branch 2. do_Slice, if step is not None branch 3. do_Dict, "Zero or more expressions" for loop 4. do_FunctionDef, if returns is not None branch 5. the visitor method itself has several untested sections BTW, I had to change the hard-coded directory path in make_file_data in order to get all the tests to pass -- 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 leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAO5X8Cy%3DXRY6A78WDeJ2xwqa5%2BvTE-TiQvgGXXguZiXVaa3v8Q%40mail.gmail.com.