Skip to content

Commit d363217

Browse files
committed
Update checksum test for Unicode 13; extend test to all of Unicode
This commit combines the following two upstream patches: python/cpython#18913 commit c77aa2d60b420747886f4258cf159bdbb7354100 Author: Benjamin Peterson <benjamin@python.org> Date: Tue Mar 10 21:18:33 2020 -0700 bpo-39926: Update unicodedata checksum tests for Unicode 13.0 update. (GH-18913) I forget these tests required the cpu resource. python/cpython#15125 commit 6954be815a16fad11d1d66be576865bbbeb2b97d Author: Greg Price <gnprice@gmail.com> Date: Thu Sep 12 02:25:25 2019 -0700 closes bpo-37758: Extend unicodedata checksum tests to cover all of Unicode. (GH-15125) Unicode has grown since Python first gained support for it, when Unicode itself was still rather new. This pair of test cases was added in commit 6a20ee7de back in 2000, and they haven't needed to change much since then. But do change them to look beyond the Basic Multilingual Plane (range(0x10000)) and cover all 17 planes of Unicode's final form. This adds about 5 seconds to the test suite's runtime. Mark the tests as CPU-using accordingly.
1 parent b4bfe6d commit d363217

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_unicodedata2.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sys
1212
import unittest
1313
import hashlib
14+
from test.support import requires_resource
1415

1516
encoding = 'utf-8'
1617
errors = 'surrogatepass'
@@ -36,12 +37,14 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
3637

3738
# Update this if the database changes. Make sure to do a full rebuild
3839
# (e.g. 'make distclean && make') to get the correct checksum.
39-
expectedchecksum = 'c44a49ca7c5cb6441640fe174ede604b45028652'
40+
expectedchecksum = 'd1e37a2854df60ac607b47b51189b9bf1b54bfdb'
41+
42+
@requires_resource('cpu')
4043
def test_function_checksum(self):
4144
data = []
4245
h = hashlib.sha1()
4346

44-
for i in range(0x10000):
47+
for i in range(sys.maxunicode + 1):
4548
char = chr(i)
4649
data = [
4750
# Properties

0 commit comments

Comments
 (0)