jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378201 )
Change subject: site_tests.test_search_where_title: Use assertIn instead of assertTrue
......................................................................
site_tests.test_search_where_title: Use assertIn instead of assertTrue
This way unittest will produce a more descriptive error message by showing
AssertionError: 'wiki' not found in <page title>
instead of
AssertionError: False is not true
Change-Id: I98059d53d5b2be1673743503e4809ceab7e7e869
---
M tests/site_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 74d3b11..add575c 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1505,7 +1505,7 @@
get_redirects=True, where='title'):
self.assertIsInstance(hit, pywikibot.Page)
self.assertEqual(hit.namespace(), 0)
- self.assertTrue('wiki' in hit.title().lower())
+ self.assertIn('wiki', hit.title().lower())
except pywikibot.data.api.APIError as e:
if e.code in ('search-title-disabled', 'gsrsearch-title-disabled'):
raise unittest.SkipTest(
--
To view, visit https://gerrit.wikimedia.org/r/378201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I98059d53d5b2be1673743503e4809ceab7e7e869
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>