jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/879106 )

Change subject: Improve error testing
......................................................................

Improve error testing

Change-Id: I060374f45a210431dd5f7aa674fb5921d745a581
---
M tests/wikibase_tests.py
1 file changed, 16 insertions(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 3bb61e5..6dbcf06 100755
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -499,6 +499,13 @@
             pywikibot.WbTime(site=repo, precision=15)
         with self.assertRaisesRegex(ValueError, regex):
             pywikibot.WbTime(site=repo, precision='invalid_precision')
+        regex = r'^Invalid precision: "15"$'
+        with self.assertRaisesRegex(ValueError, regex):
+            pywikibot.WbTime(site=repo, year=2020, precision=15)
+        regex = r'^Invalid precision: "invalid_precision"$'
+        with self.assertRaisesRegex(ValueError, regex):
+            pywikibot.WbTime(site=repo, year=2020,
+                             precision='invalid_precision')

     def test_comparison(self):
         """Test WbTime comparison."""

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/879106
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I060374f45a210431dd5f7aa674fb5921d745a581
Gerrit-Change-Number: 879106
Gerrit-PatchSet: 1
Gerrit-Owner: RPI2026F1 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to