Skip to content

Commit

Permalink
Disable plugin if collectonly active. Closes pytest-dev#327.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Sep 4, 2019
1 parent 7a9f240 commit ba1a377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _prepare_cov_source(cov_source):

@pytest.mark.tryfirst
def pytest_load_initial_conftests(early_config, parser, args):
if early_config.known_args_namespace.cov_source:
if early_config.known_args_namespace.cov_source and not early_config.known_args_namespace.collectonly:
plugin = CovPlugin(early_config.known_args_namespace, early_config.pluginmanager)
early_config.pluginmanager.register(plugin, '_cov')

Expand Down

0 comments on commit ba1a377

Please sign in to comment.