[3.10] bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757) (GH-26885)
(cherry picked from commit 4f725261c6cf23d259e8fdc205e12b76ef4d2d31, fbff5387c3e1f3904420fa5a27738c6c5881305b, and 8cec740820fc875117bfa7b6bdb10202ebeb8fd5)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Automerge-Triggered-By: GH:vstinner
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index c6bbe3f..213b3cf 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -12,7 +12,7 @@
import unicodedata
import unittest
from test.support import (open_urlresource, requires_resource, script_helper,
- cpython_only)
+ cpython_only, check_disallow_instantiation)
class UnicodeMethodsTest(unittest.TestCase):
@@ -229,7 +229,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
@cpython_only
def test_disallow_instantiation(self):
# Ensure that the type disallows instantiation (bpo-43916)
- self.assertRaises(TypeError, unicodedata.UCD)
+ check_disallow_instantiation(self, unicodedata.UCD)
def test_failed_import_during_compiling(self):
# Issue 4367