jenkins-bot has submitted this change and it was merged.

Change subject: [FIX] chars test: Apply differences in 2.6/3.3
......................................................................


[FIX] chars test: Apply differences in 2.6/3.3

The test in 7a98d58f was applying the status of the Unicode standard used in
Python 2.7 and 3.4 but Python 3.3 and 2.6 were using revisions of the standards
where additional codepoints weren't defined yet. The test now acknowledges Cn
as a valid category too.

Change-Id: Ia920f892c44a2f35f564a1e371f036ad1984c5ca
---
M tests/tools_chars_tests.py
1 file changed, 2 insertions(+), 8 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/tools_chars_tests.py b/tests/tools_chars_tests.py
index e7c45d1..4c44b55 100644
--- a/tests/tools_chars_tests.py
+++ b/tests/tools_chars_tests.py
@@ -36,18 +36,12 @@
     def test_category_cf(self):
         """Test that all characters in _category_cf are actually in Cf."""
         invalid = {}
+        # Cn are undefined characters (and were defined later in Unicode)
         for char in chars._category_cf:
             cat = unicodedata.category(char)
-            if cat != 'Cf':
+            if cat not in ('Cf', 'Cn'):
                 invalid[char] = cat
         if sys.version_info[0] == 2:
-            # These weren't defined in Unicode 5.2 (which is what Py2 is using)
-            self.assertEqual(invalid.pop('\u0604'), 'Cn')
-            self.assertEqual(invalid.pop('\u061c'), 'Cn')
-            self.assertEqual(invalid.pop('\u2066'), 'Cn')
-            self.assertEqual(invalid.pop('\u2067'), 'Cn')
-            self.assertEqual(invalid.pop('\u2068'), 'Cn')
-            self.assertEqual(invalid.pop('\u2069'), 'Cn')
             # This category has changed between Unicode 6 and 7 to Cf
             self.assertEqual(invalid.pop('\u180e'), 'Zs')
         self.assertCountEqual(invalid.items(), [])

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia920f892c44a2f35f564a1e371f036ad1984c5ca
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: XZise <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to