jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1319148?usp=email )
Change subject: tests: increase coverage of tests
......................................................................
tests: increase coverage of tests
Change-Id: I685ca36b2caa3700190cd8d1be5563bfbfa8a5a1
---
M tests/make_dist_tests.py
M tests/site_decorators_tests.py
M tests/tools_deprecate_tests.py
3 files changed, 6 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/make_dist_tests.py b/tests/make_dist_tests.py
index 5b70779..ea9d9f7 100755
--- a/tests/make_dist_tests.py
+++ b/tests/make_dist_tests.py
@@ -52,7 +52,7 @@
msg,
'Distribution must not be a developmental release to upload'
)
- else:
+ else: # pragma: no cover
self.assertEqual(msg, '')
@patch.object(make_dist.SetupBase, '_check_module', return_value=False)
diff --git a/tests/site_decorators_tests.py b/tests/site_decorators_tests.py
index 3977dd4..655cf45 100755
--- a/tests/site_decorators_tests.py
+++ b/tests/site_decorators_tests.py
@@ -203,7 +203,7 @@
@need_version('1.24')
def too_new(self) -> bool:
"""Method which is to new."""
- return True
+ return True # pragma: no cover
@need_version('1.23')
def old_enough(self) -> bool:
@@ -219,13 +219,13 @@
@deprecated
def deprecated_unavailable_method(self) -> bool:
"""Method which is to new and then deprecated."""
- return True
+ return True # pragma: no cover
@deprecated
@need_version('1.24')
def deprecated_unavailable_method2(self) -> bool:
"""Method which is deprecated first and then to new."""
- return True
+ return True # pragma: no cover
@need_version('1.22')
@deprecated
diff --git a/tests/tools_deprecate_tests.py b/tests/tools_deprecate_tests.py
index 141d625..4764c9a 100755
--- a/tests/tools_deprecate_tests.py
+++ b/tests/tools_deprecate_tests.py
@@ -279,6 +279,7 @@
rv = deprecated_func(1)
self.assertEqual(rv, 1)
+ self.assertDeprecation(self.NO_INSTEAD)
self.assertOneDeprecationParts(__name__ + '.deprecated_func')
def test_deprecated_function2(self) -> None:
@@ -295,6 +296,7 @@
"""Test @deprecated with functions, using instead."""
rv = deprecated_func_instead('a')
self.assertEqual(rv, 'a')
+ self.assertDeprecation(self.INSTEAD)
self.assertOneDeprecationParts(__name__ + '.deprecated_func_instead',
'baz')
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1319148?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I685ca36b2caa3700190cd8d1be5563bfbfa8a5a1
Gerrit-Change-Number: 1319148
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]