Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f290f1

Browse files
committed
Use typing_extensions only if needed
This makes the typing-extensions test dependency < 3.11 only, andconditionally imports assert_type from typing or typing_extensionsdepending on the Python version.
1 parent18608e4 commit1f290f1

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
importitertools
12+
importsys
1213
fromtypingimportType
1314

15+
ifsys.version_info>= (3,11):
16+
fromtypingimportassert_type
17+
else:
18+
fromtyping_extensionsimportassert_type
19+
1420
importpytest
1521
fromtyping_extensionsimportassert_type
1622

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp