XZise has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/47/214047/1

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