question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for conditional coverage

See original GitHub issue

Originally reported by Thomas Pansino (Bitbucket: tpansino, GitHub: tpansino)


Coming from the Perl world with its excellent Devel::Cover module, I’m quite surprised that the most popular equivalent coverage package in Python doesn’t have any support for conditional coverage. This can be a useful metric similiar to branch coverage to ensure all combinations of boolean conditionals are tested properly.

The best tool I’ve found so far to measure this is @desmaj’s instrumental utility, which is in need of some updates for Python 3 compatibility and some general polishing and love.

I’m thinking there may be an opportunity here to incorporate some of the work done in instrumental into coverage.py. I don’t know that I have the Python expertise to do the work myself, but I’m happy to learn and contribute in whatever way I can.

First thing’s first - where does this idea fall on the coverage.py roadmap?


Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
nedbatcommented, Nov 2, 2019

5.0 alphas are available now, and feedback is appreciated. I’m hoping to have the beta this month.

0reactions
nedbatcommented, Aug 10, 2020

I see. https://github.com/nedbat/coveragepy/issues/660#issuecomment-399708946 is a suggestions by @tpansino. It is not implemented yet in coverage.py. I’m not sure the status of their work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

coverage-conditional-plugin - wemake.services - GitHub
Conditional coverage based on any rules you define! Some projects have different parts that relies on different environments: Python version, some code is...
Read more >
Conditional coverage - sobolevn.me
Conditional coverage allows you to add or ignore lines based on predicates and collecting required bits of coverage from every run, not just ......
Read more >
Code Coverage Tutorial: Branch, Statement, Function Coverage
This methodology aims at ensuring that every branch appearing in each conditional structure gets executed in source code. For instance, in the ...
Read more >
Code Coverage Tutorial: Branch, Statement, Decision, FSM
Condition Coverage or expression coverage is a testing method used to test and evaluate the variables or sub-expressions in the conditional ...
Read more >
Code coverage testing, when enough is enough - JS.dev
Coverage testing in application development is often a tough, ... frequently a sequence of code, function or conditional block was executed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found