jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/708190 )
Change subject: [bugfix] Minor flake8 warning ......................................................................
[bugfix] Minor flake8 warning
For the last month or so I've gotten the following warning whenever I run tox...
./tests/category_tests.py: line 163:9: H214: Use assertIn/NotIn(A, B) rather than assertTrue/False(A in/not in B) when checking collection contents.
Honestly I don't know why or why Gerrit's checks don't have it.
Bug: T287434 Change-Id: Ibf66b5b605334855637ca49ffb305a070df98cac --- M tests/category_tests.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/category_tests.py b/tests/category_tests.py index 1dd3dfa..a39a684 100644 --- a/tests/category_tests.py +++ b/tests/category_tests.py @@ -160,7 +160,7 @@ # Invalid title case cat3 = pywikibot.Category(site, '2021 establishments in Orissa') cat4 = pywikibot.Category(site, '2021 establishments in Odisha') - self.assertTrue('{{title year}}' in cat3.text) + self.assertIn('{{title year}}', cat3.text) self.assertTrue(cat3.isCategoryRedirect()) self.assertFalse(cat4.isCategoryRedirect()) tgt = cat3.getCategoryRedirectTarget()
pywikibot-commits@lists.wikimedia.org