Giter Club home page Giter Club logo

Comments (17)

alfredodeza avatar alfredodeza commented on July 30, 2024

Ouch. Let me try and reproduce. Thanks for reporting!

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

If you could, would you mind inserting this between line 219 and 220 in the s:LineNumberParse function?:

echom a:numbers

That function is breaking because that value has something that it can't handle

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

I added the debug output you asked me for.

  • First, I just called "Coveragepy report" after I changed my code to have 100% coverage --> "Coveragepy report" SUCCESS
  • Deleting .coverage --> message that coverage data is missing SUCCESS
  • Executing only some tests yielding lower coverage --> FAIL, output:
   201, 266-268, 273, 280, 283, 328-332, 337-342, 345, 367, 407-458, 467-477, 506, 514, 520-521, 524, 265->266, 279->280, 282->283, 291->-297, 291->-295,
291->-294, 291->-293, 291->-291, 327->328, 334->337, 344->345, 382->385, 387->390, 391->394, 462->467, 517->520, 523->524
Error detected while processing function <SNR>79_Proxy..<SNR>79_CoveragepyReport..<SNR>79_ReportParse..<SNR>79_LineNumberParse:
line   11:
E727: Start past end
E714: List required

I assume lineNumberParse can not handle the branch coverage report tokens so I disabled and reran

  • Set "branch = False" in my .coveragerc and rerun same test --> FAIL, different output:
   201, 266-268, 273, 280, 283, 328-332, 337-342, 345, 367, 407-458, 467-477, 506, 514, 520-521, 524
Error detected while processing function <SNR>79_Proxy..<SNR>79_HighlightMissing:
line    8:
E684: list index out of range: 1
E15: Invalid expression: matchlist(expand("%:p"), '\v(.*)(.py)')[1]

So I assume the original issue I had is that "coveragepy.vim" does not support the report of branch coverage as I don't see a parse token '->' or similar in the function LineNumberParse. We might be able to add this. Additionally though I seem to have hit yet another issue.

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

Very good catch, thanks for looking into this. It should be straightforward to fix

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

BTW, if you want to also visualize branch coverage: the html generator from python coverage module uses yellow for uncovered branches, e.g. you could use something like

hi branchuncovered guifg=#ffff00 guibg=yellow ctermfg=40 ctermbg=40

in your code maybe?

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

That looks fantastic. I agree!

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

@alfredodeza did I get you right that you will prepare a fix some time? I am not feeling confident I can really provide a good PR at this time though I would be happy to help testing a change.

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

yep, I will tackle this one. I just fixed a couple of other issues today, this one is coming up next :)

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

With commit b367762 this should no longer break, but alas, proper reporting on branch coverage is not yet done.

At least it doesn't break! I will try to get proper branch coverage reporting soon

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

hm, did not fully work for me. If without '--branch' everything seems to be ok now but when gathering coverage with '--branch':

Error detected while processing function <SNR>77_Proxy..<SNR>77_HighlightMissing:
line   14:
E474: Invalid argument

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

I am not sure but actually it looks like the report always reports 100% but I observe the same problem in e941907 so somehow it broke for me but I don't know how. help appreciated.

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

This is odd, because I can't replicate. This is what I am trying:

coverage run --branch `which py.test`
vim file.py
:Coveragepy show

I can navigate and see covered/uncovered lines. Granted, I am not parsing branch coverage yet. But I can't get this to break. If you could, would you mind giving me something so I can replicate?

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

I was finally able to get something that would replicate the problem. Will fix soon

screen shot 2016-01-19 at 4 08 12 pm

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

well, trying to come up with a "minimum failing example" I struggle because everything looks ok so can you disregard my last but it's good you can know replicate the "HighlightMissing" something :-)

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

@okurz can you try and use the newest changes from master? I have something that should work for you

from coveragepy.vim.

alfredodeza avatar alfredodeza commented on July 30, 2024

Commit a44f1bc

from coveragepy.vim.

okurz avatar okurz commented on July 30, 2024

It works perfectly. Thank you very much.

from coveragepy.vim.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.