Skip to main content

# 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!

# 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][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][faraday] for letting me write the tool and use it in our product.

[pasta]: https://github.com/google/pasta/ [faraday]: https://github.com/infobyte/faraday/

Metadata

Release files for magicov 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magicov 0.2
File Size Uploaded Provenance Actions
magicov-0.2.tar.gz 5.7 kB Without provenance Details for magicov-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magicov 0.2
File Interpreter ABI Platform Actions
magicov-0.2-py3.7.egg Legacy Egg format - - Details for magicov-0.2-py3.7.egg

Total release size: 16.5 kB

Release files / magicov-0.2.tar.gz

Download URL magicov-0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
719d3681ae33eacd56befd39c618d6824ce7f297a21720975e6e1860d47ad0f1
BLAKE2b-256 checksum
How to use checksums
0cb21a388d3d056fd7123dd0ef2836d02c9d495a4b218389696fbeab4de363eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / magicov-0.2-py3.7.egg

Download URL magicov-0.2-py3.7.egg
Size 10.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
4f039ddcbbb250b05bbe9ad493e417ecbeeedbb40e98d0e75cb9f309748f669a
BLAKE2b-256 checksum
How to use checksums
e10a12d7d3c4dccb9b45fd1e7ba9347616d1db4fa87d12ba74726030b356173c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for magicov 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page