jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/667385 )

Change subject: [fix] Safely restore cosmetic_changes_mylang_only setting
......................................................................

[fix] Safely restore cosmetic_changes_mylang_only setting

Bug: T275981
Change-Id: I75977d27cce20769bc1b403847fc51e7fe11e9ef
---
M tests/i18n_tests.py
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py
index 1732740..8b6b99a 100644
--- a/tests/i18n_tests.py
+++ b/tests/i18n_tests.py
@@ -518,9 +518,11 @@
         self.orig_output = bot.ui.output
         bot.ui._raw_input = lambda *args, **kwargs: 'dummy input'
         bot.ui.output = self._capture_output
+        self.old_cc_setting = config.cosmetic_changes_mylang_only

     def tearDown(self):
         """Restore the output and input methods."""
+        config.cosmetic_changes_mylang_only = self.old_cc_setting
         bot.ui._raw_input = self.orig_raw_input
         bot.ui.output = self.orig_output
         super().tearDown()
@@ -543,7 +545,6 @@
         page = pywikibot.Page(self.site, 'Test')
         page.text = 'Some    content    with    spaces.'
         # check cc settings
-        old_setting = config.cosmetic_changes_mylang_only
         config.cosmetic_changes_mylang_only = False
         self.assertFalse(page.isTalkPage())
         self.assertEqual(page.content_model, 'wikitext')
@@ -554,8 +555,6 @@
         summary = 'Working on Test page at site {}'.format(self.site)
         msg = page._cosmetic_changes_hook(summary)
         self.assertEqual(msg, summary + '; cosmetic changes')
-        # restore setting
-        config.cosmetic_changes_mylang_only = old_setting


 class TestExtractPlural(TestCase):

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/667385
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: I75977d27cce20769bc1b403847fc51e7fe11e9ef
Gerrit-Change-Number: 667385
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Isaacandy <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to