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):

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/697622
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: Id2157cda3319d47e0df8462cc488f7bc3de0658d
Gerrit-Change-Number: 697622
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[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