summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-06-29 18:36:08 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-06-29 18:36:29 -0400
commita3333b4359859f796bec18fe767fe251f88775db (patch)
treedcfd355fa03940476d389d657b645456bc80195d
parente9e703c7885840412295a0aaf3c84b5244483881 (diff)
downloadpython-coveragepy-git-a3333b4359859f796bec18fe767fe251f88775db.tar.gz
A little more about Coverage.current
-rw-r--r--CHANGES.rst3
-rw-r--r--coverage/control.py8
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: