From 7b2da8e25e3cb556145ee55cbbf73ca678d38484 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 9 Nov 2015 16:35:27 -0800 Subject: [PATCH] SupyMisc: skip testTldInternationalTLDs on Python 2 only --- SupyMisc/test.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/SupyMisc/test.py b/SupyMisc/test.py index a81d1bb..de785c7 100644 --- a/SupyMisc/test.py +++ b/SupyMisc/test.py @@ -45,16 +45,12 @@ class SupyMiscTestCase(PluginTestCase): @unittest.skipUnless(network, "Network-based tests have been disabled via " "--no-network") - @unittest.skip("Doesn't work yet... Raises UnicodeDecodeError on Python 2.") + @unittest.skipIf(version_info[0] <= 2, "Doesn't work (raises UnicodeDecodeError) on Python 2.") def testTldInternationalTLDs(self): # https://www.iana.org/domains/root/db/xn--io0a7i # Chinese internationalized domain for 'network' (similar to .net) self.assertNotError('tld xn--io0a7i') - if version_info[0] >= 3: - self.assertNotError('tld \u7f51\u7edc') - else: - from codecs import unicode_escape_decode as u - self.assertNotError('tld '+u('\u7f51\u7edc')[0]) + self.assertNotError('tld \u7f51\u7edc') def testColorwheel(self): self.assertRegexp('colors', '.*\x03.*')