jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/766822 )
Change subject: [tests] ignore code coverage if disabled_tests is empty ......................................................................
[tests] ignore code coverage if disabled_tests is empty
Change-Id: Ib2c86480d09bc087d62bd760edfb6c13151271d7 --- M tests/__init__.py M tests/api_tests.py 2 files changed, 3 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/__init__.py b/tests/__init__.py index 402a047..4f05ff9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -175,6 +175,7 @@ 'site_login_logout', # separate Login CI action }
+# remove "# pragma: no cover" below if this set is not empty disabled_tests = {} # type: Dict[str, List[str]]
@@ -236,7 +237,7 @@
for module in modules: module_class_name = 'tests.' + module + '_tests' - if module in disabled_tests: + if module in disabled_tests: # pragma: no cover discovered = loader.loadTestsFromName(module_class_name) enabled_tests = [] for cls in discovered: diff --git a/tests/api_tests.py b/tests/api_tests.py index 75e3d3b..6d6447d 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -7,6 +7,7 @@ # import datetime import types +import unittest from collections import defaultdict from contextlib import suppress from unittest.mock import patch @@ -23,7 +24,6 @@ DefaultDrySiteTestCase, DefaultSiteTestCase, TestCase, - unittest, ) from tests.utils import FakeLoginManager
pywikibot-commits@lists.wikimedia.org