Comments (17)
Ouch. Let me try and reproduce. Thanks for reporting!
from coveragepy.vim.
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.
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.
Very good catch, thanks for looking into this. It should be straightforward to fix
from coveragepy.vim.
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.
That looks fantastic. I agree!
from coveragepy.vim.
@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.
yep, I will tackle this one. I just fixed a couple of other issues today, this one is coming up next :)
from coveragepy.vim.
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.
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.
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.
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.
I was finally able to get something that would replicate the problem. Will fix soon
from coveragepy.vim.
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.
@okurz can you try and use the newest changes from master? I have something that should work for you
from coveragepy.vim.
Commit a44f1bc
from coveragepy.vim.
It works perfectly. Thank you very much.
from coveragepy.vim.
Related Issues (18)
- HighlightMissing getting called HOT 7
- Broken with coverage 4.0.3 HOT 5
- Error when using this plugin HOT 6
- Bad window height when showing report HOT 6
- Request: alternative, subtler display style. HOT 14
- Should only unplace own signs HOT 2
- Act as a provider for google/vim-coverage? HOT 1
- Highlighting does not work in Windows HOT 4
- Signs are always placed in the first pane HOT 9
- Error 117: Unknown function: execute HOT 9
- Can we have an option to not open LastSession.coveragepy window at the bottom? HOT 3
- Detecting coverage executable, handling py2/py3 HOT 2
- Couldn't get Coveragpy command to load HOT 4
- Unable to run plugin HOT 1
- test cases in subfolder HOT 6
- refresh coverage lines HOT 7
- Session show toggle off sign marks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coveragepy.vim.