summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_unicodedata.py22
1 files changed, 5 insertions, 17 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index a52b6de..7bc196b 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -1,4 +1,4 @@
-""" Test script for the unicodedata module.
+""" Tests for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
@@ -6,16 +6,12 @@
"""
+import hashlib
import sys
+import unicodedata
import unittest
-import hashlib
from test.support import script_helper
-encoding = 'utf-8'
-errors = 'surrogatepass'
-
-
-### Run tests
class UnicodeMethodsTest(unittest.TestCase):
@@ -61,20 +57,12 @@ class UnicodeMethodsTest(unittest.TestCase):
(char + 'ABC').title(),
]
- h.update(''.join(data).encode(encoding, errors))
+ h.update(''.join(data).encode('utf-8', 'surrogatepass'))
result = h.hexdigest()
self.assertEqual(result, self.expectedchecksum)
class UnicodeDatabaseTest(unittest.TestCase):
-
- def setUp(self):
- # In case unicodedata is not available, this will raise an ImportError,
- # but the other test cases will still be run
- import unicodedata
- self.db = unicodedata
-
- def tearDown(self):
- del self.db
+ db = unicodedata
class UnicodeFunctionsTest(UnicodeDatabaseTest):