Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697622 )
Change subject: [bugfix] botMayEdit has no function cache_clear() ......................................................................
[bugfix] botMayEdit has no function cache_clear()
After dopping lru_cache fix tests accordingly
Change-Id: Id2157cda3319d47e0df8462cc488f7bc3de0658d --- M tests/page_tests.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/tests/page_tests.py b/tests/page_tests.py index 5e59ec3..ffd1b98 100644 --- a/tests/page_tests.py +++ b/tests/page_tests.py @@ -760,7 +760,7 @@
def tearDown(self): """Cleanup cache.""" - self.page.botMayEdit.cache_clear() + del self.page._bot_may_edit super().tearDown()
def _run_test(self, template, user, expected_result): @@ -769,7 +769,7 @@ self.page._text = template % {'user': user} with self.subTest(template=template, user=user): self.assertEqual(self.page.botMayEdit(), expected_result) - self.page.botMayEdit.cache_clear() + del self.page._bot_may_edit
@mock.patch.object(config, 'ignore_bot_templates', False) def test_bot_may_edit_nobots_ok(self): @@ -842,7 +842,7 @@ self.page._text = '{{bots|%s=}}' % param with self.subTest(template=self.page.text, user=user, param=param): self.assertTrue(self.page.botMayEdit()) - self.page.botMayEdit.cache_clear() + del self.page._bot_may_edit
@mock.patch.object(config, 'ignore_bot_templates', False) def test_bot_may_edit_bots_nok(self):
pywikibot-commits@lists.wikimedia.org