Skip to content

Commit 70d5205

Browse files
committed
Properly skipped tests
1 parent c716ff1 commit 70d5205

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/test_typing_extensions.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5384,17 +5384,18 @@ def test_valid_uses(self):
53845384
self.assertEqual(C1.__origin__, C2.__origin__)
53855385
self.assertNotEqual(C1, C2)
53865386

5387-
# Test collections.abc.Callable too.
5388-
if sys.version_info[:2] >= (3, 9):
5389-
C3 = collections.abc.Callable[Concatenate[int, P], int]
5390-
C4 = collections.abc.Callable[Concatenate[int, T, P], T]
5391-
self.assertEqual(C3.__origin__, C4.__origin__)
5392-
self.assertNotEqual(C3, C4)
5393-
5394-
# Callable with Ellipsis cannot be constructed in 3.8 and below 3.9.2
5395-
if sys.version_info[:2] <= (3, 9, 2):
5396-
return
5387+
@skipUnless(TYPING_3_9_0, "Needs PEP 585")
5388+
def test_collections_abc_callable(self):
5389+
P = ParamSpec('P')
5390+
T = TypeVar('T')
5391+
C3 = collections.abc.Callable[Concatenate[int, P], int]
5392+
C4 = collections.abc.Callable[Concatenate[int, T, P], T]
5393+
self.assertEqual(C3.__origin__, C4.__origin__)
5394+
self.assertNotEqual(C3, C4)
53975395

5396+
@skipUnless(sys.version_info >= (3, 9, 3), "Callable with Ellipsis cannot be constructed below 3.9.2")
5397+
def test_valid_uses_py39_plus(self):
5398+
T = TypeVar('T')
53985399
C5 = Callable[Concatenate[int, ...], int]
53995400
C6 = Callable[Concatenate[int, T, ...], T]
54005401
self.assertEqual(C5.__origin__, C6.__origin__)

0 commit comments

Comments
 (0)