From e0a550b27c984b2ca025090174ae73cc9a6a3f76 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 10 Dec 2023 14:52:41 -0500 Subject: [PATCH] fix: undeprecate `coverage annotate` --- CHANGES.rst | 4 ++++ coverage/control.py | 3 --- tests/test_annotate.py | 7 +------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8ae49fb04..f46c11bb5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,10 @@ Unreleased matching any of the lines, closing `issue 684`_. Thanks, `Jan Rusak, Maciej Kowalczyk and Joanna Ejzel `_. +- The ``coverage annotate`` command used to announce that it would be removed + in a future version. Enough people got in touch to say that they use it, so + it will stay. Don't expect it to keep up with other new features though. + - Added new :ref:`debug options `: - ``pytest`` writes the pytest test name into the debug output. diff --git a/coverage/control.py b/coverage/control.py index 5d772f8e7..5c263e4af 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -1110,9 +1110,6 @@ def annotate( See :meth:`report` for other arguments. """ - print("The annotate command will be removed in a future version.") - print("Get in touch if you still use it: ned@nedbatchelder.com") - self._prepare_data_for_reporting() with override_config( self, diff --git a/tests/test_annotate.py b/tests/test_annotate.py index e8a2cb695..3819d6878 100644 --- a/tests/test_annotate.py +++ b/tests/test_annotate.py @@ -123,10 +123,5 @@ def f(x): cov = coverage.Coverage() self.start_import_stop(cov, "mae") cov.annotate() - assert self.stdout() == ( - "1\n" + - "2\n" + - "The annotate command will be removed in a future version.\n" + - "Get in touch if you still use it: ned@nedbatchelder.com\n" - ) + assert self.stdout() == "1\n2\n" compare(gold_path("annotate/mae"), ".", "*,cover")