rdobuilder d8f04f
From 240d811b00fb1cedfc42848e6efa6137bf009e8d Mon Sep 17 00:00:00 2001
rdobuilder d8f04f
From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
rdobuilder d8f04f
Date: Sat, 2 Jan 2021 23:26:26 +0800
rdobuilder d8f04f
Subject: [PATCH] Update test_typing_extensions.py
rdobuilder d8f04f
rdobuilder d8f04f
---
rdobuilder d8f04f
 typing_extensions/src_py3/test_typing_extensions.py | 8 +++++---
rdobuilder d8f04f
 1 file changed, 5 insertions(+), 3 deletions(-)
rdobuilder d8f04f
rdobuilder d8f04f
diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py
rdobuilder d8f04f
index b89b396..98d02a0 100644
rdobuilder d8f04f
--- a/typing_extensions/src_py3/test_typing_extensions.py
rdobuilder d8f04f
+++ b/typing_extensions/src_py3/test_typing_extensions.py
rdobuilder d8f04f
@@ -51,6 +51,7 @@
rdobuilder d8f04f
 TYPING_3_5_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 1)
rdobuilder d8f04f
 TYPING_3_5_3 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 3)
rdobuilder d8f04f
 TYPING_3_6_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 6, 1)
rdobuilder d8f04f
+TYPING_3_10_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 10, 0)
rdobuilder d8f04f
 
rdobuilder d8f04f
 # For typing versions where issubclass(...) and
rdobuilder d8f04f
 # isinstance(...) checks are forbidden.
rdobuilder d8f04f
@@ -1240,8 +1241,9 @@ class P(PR[int, str], Protocol):
rdobuilder d8f04f
             self.assertIsSubclass(P, PR)
rdobuilder d8f04f
             with self.assertRaises(TypeError):
rdobuilder d8f04f
                 PR[int]
rdobuilder d8f04f
-            with self.assertRaises(TypeError):
rdobuilder d8f04f
-                PR[int, 1]
rdobuilder d8f04f
+            if not TYPING_3_10_0:
rdobuilder d8f04f
+                with self.assertRaises(TypeError):
rdobuilder d8f04f
+                    PR[int, 1]
rdobuilder d8f04f
             class P1(Protocol, Generic[T]):
rdobuilder d8f04f
                 def bar(self, x: T) -> str: ...
rdobuilder d8f04f
             class P2(Generic[T], Protocol):
rdobuilder d8f04f
@@ -1254,7 +1256,7 @@ class Test:
rdobuilder d8f04f
                 def bar(self, x: str) -> str:
rdobuilder d8f04f
                     return x
rdobuilder d8f04f
             self.assertIsInstance(Test(), PSub)
rdobuilder d8f04f
-            if TYPING_3_5_3:
rdobuilder d8f04f
+            if TYPING_3_5_3 and not TYPING_3_10_0:
rdobuilder d8f04f
                 with self.assertRaises(TypeError):
rdobuilder d8f04f
                     PR[int, ClassVar]
rdobuilder d8f04f