Last active
November 25, 2016 07:13
-
-
Save ak64th/afa1c313a2a31220206393c21bda0089 to your computer and use it in GitHub Desktop.
run tests and get coverage report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import coverage | |
class coverall(object): | |
def __enter__(self): | |
self.coverage = coverage.coverage() | |
self.coverage.erase() | |
self.coverage.start() | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
self.coverage.stop() | |
self.coverage.save() | |
self.coverage.report() | |
with coverall(): | |
# ... | |
# run tests | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment