GithubHelp home page GithubHelp logo

Hits per line about coveralls-python HOT 9 CLOSED

thekevjames avatar thekevjames commented on May 20, 2024
Hits per line

from coveralls-python.

Comments (9)

xanderdunn avatar xanderdunn commented on May 20, 2024 3

I find this feature useful in my C++ project because it gives me a good idea of how well a given line of code is actually tested. If the line of code is run only once, then I know there is only one test that executes it and this is suboptimal test coverage. If a line of code is run 24,000 times, then I know we've got far better testing of it (It's probably safe to assume that the tests aren't calling the exact same thing many times over).

from coveralls-python.

coagulant avatar coagulant commented on May 20, 2024

As far as I know coverage.py does not provide hits per line stats, that's why they're not submitted to coveralls. Does not matter if branch coverage is enabled or not. If I'm not correct, you're welcome to prove me wrong ;)

from coveralls-python.

myint avatar myint commented on May 20, 2024

Right, it does not. I'm just suggesting that you should use the branch coverage statistics to provide additional information. Right now, you do something like the following.

if x:      (1)
    x += x (1)
print(x)   (1)

Instead, if branch coverage is enabled (and both branches are covered), you should be doing this instead.

if x:      (2)
    x += x (1)
print(x)   (1)

from coveralls-python.

coagulant avatar coagulant commented on May 20, 2024

I'm not a fan of hits per line report, so I'm not inerested in making this feature myself. However, I'm willing to merge that if anyone submits a tested pull request.

from coveralls-python.

myint avatar myint commented on May 20, 2024

Just to clarify, do you mean you are not interested in branch coverage? (Because what you support right now is hits per line.)

from coveralls-python.

coagulant avatar coagulant commented on May 20, 2024

I'm interested in branch coverage, but not the way it is displayed on coveralls right now. I'd rather see uncovered branches and/or branch coverage in percents. But I support the idea of providing extra info if that's the only current option.

from coveralls-python.

myint avatar myint commented on May 20, 2024

Ah, I agree. Hits per line is quite inadequate. I actually posted an issue (lemurheavy/coveralls-public#31) on the Coveralls repository earlier

from coveralls-python.

myint avatar myint commented on May 20, 2024

I'll wait on trying to implement anything until I hear back from the Coveralls guys. (I'd much prefer the branch coverage to be reflected in the overall percentage than try to implement the hack I described previously.)

from coveralls-python.

coagulant avatar coagulant commented on May 20, 2024

Feel free to reopen when and if branch coverage will be available on coveralls

from coveralls-python.

Related Issues (20)

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.