Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3790
Status: Errored
Duration: 41 minutes and 5 seconds
Commit: 2c33f95 (master)
Author: Kenstin
Message: Replace assertRaises with assertRaisesRegex in bot_tests.py
assertRaises is not as good of a test as assertRaisesRegex. The latter has an extra parameter to match the exception message, allowing more more precision when checking an error.
Bug: T154281
Change-Id: I5c96d8df488c37494094de2d20c76082d5933b6b
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/b3b2b70bdaf9...2c33f951…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/190830140
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/331160 )
Change subject: Replace assertRaises with assertRaisesRegex in bot_tests.py
......................................................................
Replace assertRaises with assertRaisesRegex in bot_tests.py
assertRaises is not as good of a test as assertRaisesRegex. The latter has an extra parameter to match the exception message, allowing more more precision when checking an error.
Bug: T154281
Change-Id: I5c96d8df488c37494094de2d20c76082d5933b6b
---
M tests/bot_tests.py
1 file changed, 7 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/bot_tests.py b/tests/bot_tests.py
index a0eb9a7..ad7d3bb 100644
--- a/tests/bot_tests.py
+++ b/tests/bot_tests.py
@@ -171,7 +171,7 @@
self.assertIs(exc, exception)
else:
self.assertIsNone(exc)
- self.assertRaises(StopIteration, next, self._page_iter)
+ self.assertRaisesRegex(StopIteration, '^$', next, self._page_iter)
return exit
@@ -179,6 +179,8 @@
"""Tests for the BaseBot subclasses."""
+ CANT_SET_ATTRIBUTE_RE = 'can\'t set attribute'
+ NOT_IN_TREAT_RE = 'Requesting the site not while in treat is not allowed.'
dry = True
sites = {
@@ -226,9 +228,9 @@
# Assert no specific site
self._treat_site = False
self.bot = pywikibot.bot.MultipleSitesBot(generator=self._generator())
- with self.assertRaises(AttributeError):
+ with self.assertRaisesRegex(AttributeError, self.CANT_SET_ATTRIBUTE_RE):
self.bot.site = self.de
- with self.assertRaises(ValueError):
+ with self.assertRaisesRegex(ValueError, self.NOT_IN_TREAT_RE):
self.bot.site
if PY2:
# The exc_info still contains the AttributeError :/
@@ -236,7 +238,7 @@
self.bot.treat = self._treat(self._generator())
self.bot.exit = self._exit(4)
self.bot.run()
- with self.assertRaises(ValueError):
+ with self.assertRaisesRegex(ValueError, self.NOT_IN_TREAT_RE):
self.bot.site
if PY2:
# The exc_info still contains the AttributeError :/
@@ -275,7 +277,7 @@
pywikibot.Page(self.de, 'Page 3')],
post_treat)
self.bot.exit = self._exit(2, exception=ValueError)
- self.assertRaises(ValueError, self.bot.run)
+ self.assertRaisesRegex(ValueError, 'Whatever', self.bot.run)
def test_Bot_KeyboardInterrupt(self):
"""Test normal Bot class with a KeyboardInterrupt in treat."""
--
To view, visit https://gerrit.wikimedia.org/r/331160
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5c96d8df488c37494094de2d20c76082d5933b6b
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Kenstin <k3nstin(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3789
Status: Errored
Duration: 45 minutes and 54 seconds
Commit: b3b2b70 (master)
Author: repreus
Message: Replace assertRaises with assertRaisesRegex in ui_options_tests.py
assertRaises is not as good of a test as assertRaisesRegex. The latter has an extra parameter to match the exception message, allowing more precision when checking an error.
Bug: T154281
Change-Id: Id7075b2d09078c6d56bec7138771398f1620a8e5
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/a2c4e40755a6...b3b2b70b…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/190558049
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3788
Status: Errored
Duration: 43 minutes and 43 seconds
Commit: a2c4e40 (master)
Author: dalba
Message: site_tests.py: Remove test_search_where_text and test_search_where_nearmatch
According to T154663, CirrusSearch search results are not deterministic and
these tests can fail anytime without any specific meaning. Other aspects of
the `search` method are covered by other tests.
Bug: T151369
Change-Id: I2d69900227d3c78a2c2e8cc11c22e84ddf01a0c5
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/846d82c57494...a2c4e407…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/190337442
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/330677 )
Change subject: site_tests.py: Remove test_search_where_text and test_search_where_nearmatch
......................................................................
site_tests.py: Remove test_search_where_text and test_search_where_nearmatch
According to T154663, CirrusSearch search results are not deterministic and
these tests can fail anytime without any specific meaning. Other aspects of
the `search` method are covered by other tests.
Bug: T151369
Change-Id: I2d69900227d3c78a2c2e8cc11c22e84ddf01a0c5
---
M tests/site_tests.py
1 file changed, 0 insertions(+), 15 deletions(-)
Approvals:
Lokal Profil: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 84ce632..9d47b58 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1413,21 +1413,6 @@
raise unittest.SkipTest("gsrsearch returned timeout on site: %r" % e)
raise
- def test_search_where_text(self):
- """Test the site.search() method with 'where' parameter set to text."""
- self.assertEqual(list(self.site.search('wiki', total=10)),
- list(self.site.search('wiki', total=10,
- where='text')))
-
- def test_search_where_nearmatch(self):
- """Test the site.search().
-
- 'where' parameter set to 'nearmatch'.
- """
- self.assertLessEqual(len(list(self.site.search('wiki', total=10,
- where='nearmatch'))),
- len(list(self.site.search('wiki', total=10))))
-
def test_search_where_title(self):
"""Test site.search() method with 'where' parameter set to title."""
try:
--
To view, visit https://gerrit.wikimedia.org/r/330677
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d69900227d3c78a2c2e8cc11c22e84ddf01a0c5
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>