plasma-umass / slipcover

Near Zero-Overhead Python Code Coverage
Apache License 2.0
475 stars 17 forks source link

Fix divide by zero error when test file is empty #35

Closed diceroll123 closed 1 year ago

diceroll123 commented 1 year ago

I had an empty __init__.py file in my tests folder throwing a divide by zero error when running python -m slipcover -m pytest

This is a somewhat opinionated fix, as I consider an empty file to be 100% covered. Feel free to nitpick!

jaltmayerpizzorno commented 1 year ago

Thanks, @diceroll123!

I decided to fix it a different way (adding a test, and fixing other paths as well). What a dumb DRY bug...