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

Change subject: [IMPROV] chars tests: Check Unicode version
......................................................................


[IMPROV] chars tests: Check Unicode version

Instead of just checking if Python 2 or Python 3 it's checking if the Unicode
version is below 6.3 when U+180e was in the category Zs.

Change-Id: I74b65977f2774b17c7d78d5ae8a27bed6bbf8684
---
M tests/tools_chars_tests.py
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  XZise: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/tests/tools_chars_tests.py b/tests/tools_chars_tests.py
index 4c44b55..5e2006b 100644
--- a/tests/tools_chars_tests.py
+++ b/tests/tools_chars_tests.py
@@ -9,8 +9,9 @@
 
 __version__ = '$Id$'
 
-import sys
 import unicodedata
+
+from distutils.version import StrictVersion
 
 from pywikibot.tools import chars
 
@@ -41,8 +42,8 @@
             cat = unicodedata.category(char)
             if cat not in ('Cf', 'Cn'):
                 invalid[char] = cat
-        if sys.version_info[0] == 2:
-            # This category has changed between Unicode 6 and 7 to Cf
+        if StrictVersion(unicodedata.unidata_version) < StrictVersion('6.3'):
+            # This category has changed with Unicode 6.3 to Cf
             self.assertEqual(invalid.pop('\u180e'), 'Zs')
         self.assertCountEqual(invalid.items(), [])
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I74b65977f2774b17c7d78d5ae8a27bed6bbf8684
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