XZise has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/263157

Change subject: [IMPROV] Page repr tests: Enforce console encoding
......................................................................

[IMPROV] Page repr tests: Enforce console encoding

When backporting 38589d3 to the 2.0 branch, an error occurred on the Jenkins
tests because the console encoding wasn't the expected value. Now for some
reason this is not a problem in the master branch, but in case someone uses a
custom console encoding it might fail even though it shouldn't. So this is now
enforcing the UTF-8 console encoding.

Change-Id: Ia642c34b67bf7edd0da9240a80552911b9e79918
---
M tests/page_tests.py
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/57/263157/1

diff --git a/tests/page_tests.py b/tests/page_tests.py
index 1cc6248..48829f9 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -570,6 +570,17 @@
 
     """Test for Page's repr implementation."""
 
+    def setUp(self):
+        """Force the console encoding to UTF-8."""
+        super(TestPageRepr, self).setUp()
+        self._old_encoding = config.console_encoding
+        config.console_encoding = 'utf8'
+
+    def tearDown(self):
+        """Restore the original console encoding."""
+        config.console_encoding = self._old_encoding
+        super(TestPageRepr, self).tearDown()
+
     def test_mainpage_type(self):
         u"""Test the return type of repr(Page(<main page>)) is str."""
         mainpage = self.get_mainpage()

-- 
To view, visit https://gerrit.wikimedia.org/r/263157
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia642c34b67bf7edd0da9240a80552911b9e79918
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to