From a3333b4359859f796bec18fe767fe251f88775db Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 29 Jun 2019 18:36:08 -0400 Subject: A little more about Coverage.current --- CHANGES.rst | 3 ++- coverage/control.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 3e9de91e..dbb05e61 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -32,7 +32,8 @@ Unreleased information to each covered line. Hovering over the "ctx" marker at the end of the line reveals a list of the contexts that covered the line. -- Added :meth:`Coverage.current` to get the latest started `Coverage` instance. +- Added the classmethod :meth:`Coverage.current` to get the latest started + `Coverage` instance. - Error handling during reporting has changed slightly. All reporting methods now behave the same. The ``--ignore-errors`` option keeps errors from diff --git a/coverage/control.py b/coverage/control.py index 03e36324..a8e9d15c 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -60,7 +60,13 @@ class Coverage(object): @classmethod def current(cls): - """Get the latest started `Coverage` instance, if any.""" + """Get the latest started `Coverage` instance, if any. + + Returns: a `Coverage` instance, or None. + + .. versionadded:: 5.0 + + """ if cls._instances: return cls._instances[-1] else: -- cgit v1.2.1