Skip to content

Commit

Permalink
Exclude external code from coverage analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshpilkin committed Apr 30, 2019
1 parent ae05b2d commit 2814fd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,18 @@ class pytest(Command):

def initialize_options(self):
self.pytest_args = ' '.join([
'--cov',
'--cov-report term:skip-covered',
'--cov-report annotate',
])

def finalize_options(self):
self.pytest_args = split(self.pytest_args)
for package in self.distribution.packages or []:
self.pytest_args.extend(['--cov', package])
for module in self.distribution.py_modules or []:
self.pytest_args.extend(['--cov', module + '.py'])
for script in self.distribution.scripts or []:
self.pytest_args.extend(['--cov', script])

def run(self):
from pytest import main as run_pytest # type: ignore
Expand Down

0 comments on commit 2814fd8

Please sign in to comment.