[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_select.py b/Lib/test/test_select.py
index 957a633..cf32cf2 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -88,12 +88,10 @@ def fileno(self):
         self.assertEqual(select.select([], a, []), ([], a[:5], []))
 
     def test_disallow_instantiation(self):
-        tp = type(select.poll())
-        self.assertRaises(TypeError, tp)
+        support.check_disallow_instantiation(self, type(select.poll()))
 
         if hasattr(select, 'devpoll'):
-            tp = type(select.devpoll())
-            self.assertRaises(TypeError, tp)
+            support.check_disallow_instantiation(self, type(select.devpoll()))
 
 def tearDownModule():
     support.reap_children()