Skip to content

Commit 1f290f1

Browse files
committed
Use typing_extensions only if needed
This makes the typing-extensions test dependency < 3.11 only, and conditionally imports assert_type from typing or typing_extensions depending on the Python version.
1 parent 18608e4 commit 1f290f1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ pytest-cov
88
pytest-instafail
99
pytest-mock
1010
pytest-sugar
11-
typing-extensions
11+
typing-extensions ; python_version < "3.11"

test/deprecation/test_attributes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
"""
1010

1111
import itertools
12+
import sys
1213
from typing import Type
1314

15+
if sys.version_info >= (3, 11):
16+
from typing import assert_type
17+
else:
18+
from typing_extensions import assert_type
19+
1420
import pytest
1521
from typing_extensions import assert_type
1622

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy