GitXplorerGitXplorer
c

magicov

public
11 stars
1 forks
0 issues

Commits

List of commits on branch master.
Verified
a9134374662ae985cb2fd3f69cfaf32d165215c0

Update README.md

ccript0nauta committed 5 years ago
Unverified
fbdb0fe6d1ab6ba7448e08f6f72d86b4927d6f33

Add support for async for loops

ccript0nauta committed 5 years ago
Unverified
db245f7bf44a8444e2fec03998beec7f76092058

Add support for async function definitions

ccript0nauta committed 5 years ago
Unverified
1a98da2a9bf2b9c2230478b4115a99f3ed637e47

Bump version to 0.2

ccript0nauta committed 5 years ago
Unverified
c32ce1bb315788ae08d9bdfd7202362354b81e33

Force coverage<5

ccript0nauta committed 5 years ago
Unverified
5b8e085a27eda48119886180f461cea79277c638

Merge branch 'master' of github.com:cript0nauta/magicov

ccript0nauta committed 5 years ago

README

The README file for this repository.

Magicov

Does anybody bother you about increasing the testing coverage of your Python project? Are you tired of writing useless tests just to increase that metric? Then magicov is for you!

This tool will automatically modify your code so you'll get 100% testing coverage instantly. How? Just remove all uncovered lines of your project!

This approach will make you have less code to maintain, since most of it (at least if you have low coverage) will be removed.

Usage

Install the tool with pip:

pip install magicov

Then run the Python coverage tool to fetch the coverage of your project:

coverage run '--include=your_project/*' command_to_run_tests.py

Make a backup of your code, and run magicov passing it the file with the coverage data:

magicov .coverage

You will see a lot of Python files are modified, but your test suite should pass anyway. And if everything is ok, you will have 100% coverage! You're ready to push your code to your master branch and make your boss (or testing-obsesive coworker) satisfied because of a useless metric!

Videos

My !!Con West talk explains how to use Magicov and how it was designed:

https://www.youtube.com/watch?v=2bnlI3UpH-w

Disclaimer

This is a joke project. It has no practical purpose at all. If you run this tool, all untested features of your product will be unusable.

This was just my constructive way of saying that testing coverage is not a useful metric in software projects. At least, not as important as other, more related to the product ones.

Credits

Thanks to the pasta maintainers for writing the tool that allowed me to write magicov, and for the super fast fixing of the strange bugs I reported to it.

Also, thanks to all the Faraday Team for letting me write the tool and use it in our product.