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