jenkins-bot submitted this change.

View Change

Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
[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(-)

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 change 667385. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I75977d27cce20769bc1b403847fc51e7fe11e9ef
Gerrit-Change-Number: 667385
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Isaacandy <isaac@iznd.xyz>
Gerrit-Reviewer: Merlijn van Deen <valhallasw@arctus.nl>
Gerrit-Reviewer: Siebrand <siebrand@kitano.nl>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged