summaryrefslogtreecommitdiff
path: root/coverage/runners/pytestplugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/runners/pytestplugin.py')
-rw-r--r--coverage/runners/pytestplugin.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/coverage/runners/pytestplugin.py b/coverage/runners/pytestplugin.py
deleted file mode 100644
index 0032b13b..00000000
--- a/coverage/runners/pytestplugin.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""py.test plugin hooks"""
-
-from coverage.runners.plugin import CoverageTestWrapper, OPTIONS
-
-def pytest_addoption(parser):
- """Get all the options from the coverage.runner and import them."""
- group = parser.getgroup('Coverage options')
- for opt in OPTIONS:
- group._addoption_instance(opt)
-
-def pytest_configure(config):
- """Load the runner and start it up."""
- if config.getvalue("cover_actions"):
- config.pluginmanager.register(CoveragePlugin(config), "do_coverage")
-
-class CoveragePlugin:
- """The py.test coverage plugin."""
-
- def __init__(self, config):
- self.config = config
-
- def pytest_sessionstart(self):
- """Called before session.main() is called."""
- self.coverage = CoverageTestWrapper(self.config.option)
- # XXX maybe better to start/suspend/resume coverage
- # for each single test item
- self.coverage.start()
-
- def pytest_terminal_summary(self, terminalreporter):
- """Add an additional section in the terminal summary reporting."""
- tw = terminalreporter._tw
- tw.sep('-', 'coverage')
- tw.line('Processing Coverage...')
- self.coverage.finish()