Skip to content

Commit

Permalink
Merge pull request #225 from blueyed/coverage
Browse files Browse the repository at this point in the history
Use coverage.Coverage directly
  • Loading branch information
blueyed committed Nov 15, 2018
2 parents f6442d0 + 7ce51ba commit 0822bfe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/pytest_cov/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def init():
cov_config = True

# Activate coverage for this process.
cov = active_cov = coverage.coverage(
cov = active_cov = coverage.Coverage(
source=cov_source,
branch=cov_branch,
data_suffix=True,
Expand Down
12 changes: 6 additions & 6 deletions src/pytest_cov/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ class Central(CovController):

def start(self):
"""Erase any previous coverage data and start coverage."""
self.cov = coverage.coverage(source=self.cov_source,
self.cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
config_file=self.cov_config)
self.combining_cov = coverage.coverage(source=self.cov_source,
self.combining_cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
data_file=os.path.abspath(self.cov.config.data_file),
config_file=self.cov_config)
Expand Down Expand Up @@ -185,10 +185,10 @@ def start(self):
if self.cov_config and os.path.exists(self.cov_config):
self.config.option.rsyncdir.append(self.cov_config)

self.cov = coverage.coverage(source=self.cov_source,
self.cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
config_file=self.cov_config)
self.combining_cov = coverage.coverage(source=self.cov_source,
self.combining_cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
data_file=os.path.abspath(self.cov.config.data_file),
config_file=self.cov_config)
Expand Down Expand Up @@ -224,7 +224,7 @@ def testnodedown(self, node, error):
node.slaveoutput['cov_slave_node_id']
)

cov = coverage.coverage(source=self.cov_source,
cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
data_suffix=data_suffix,
config_file=self.cov_config)
Expand Down Expand Up @@ -274,7 +274,7 @@ def start(self):
self.cov_config = self.cov_config.replace(master_topdir, slave_topdir)

# Erase any previous data and start coverage.
self.cov = coverage.coverage(source=self.cov_source,
self.cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
data_suffix=True,
config_file=self.cov_config)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_foo(idx):
import coverage
def test_foo(cov):
assert isinstance(cov, coverage.coverage)
assert isinstance(cov, coverage.Coverage)
'''

SCRIPT_FUNCARG_NOT_ACTIVE = '''
Expand Down

0 comments on commit 0822bfe

Please sign in to comment.