Skip to content

Commit db68940

Browse files
committed
optional is intended for testing
1 parent 7ae7f7b commit db68940

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ repos:
3030
hooks:
3131
- id: pyupgrade
3232
args: [--py310-plus]
33-
exclude: tests/eval_files/async103.py
33+
# async232 explicitly tests Optional[]
34+
exclude: tests/eval_files/async(103|232|232_asyncio).py
3435

3536
- repo: https://github.com/pycqa/isort
3637
rev: 7.0.0

tests/eval_files/async232.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def file_text_5(f: TextIOWrapper | None = None):
8181
f.read() # ASYNC232: 8, 'read', 'f', "trio"
8282

8383

84-
async def file_text_6(f: TextIOWrapper | None = None):
84+
async def file_text_6(f: Optional[TextIOWrapper] = None):
8585
f.read() # ASYNC232: 4, 'read', 'f', "trio"
8686
if f:
8787
f.read() # ASYNC232: 8, 'read', 'f', "trio"

tests/eval_files/async232_asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def file_text_5(f: TextIOWrapper | None = None):
8282
f.read() # ASYNC232_asyncio: 8, 'read', 'f'
8383

8484

85-
async def file_text_6(f: TextIOWrapper | None = None):
85+
async def file_text_6(f: Optional[TextIOWrapper] = None):
8686
f.read() # ASYNC232_asyncio: 4, 'read', 'f'
8787
if f:
8888
f.read() # ASYNC232_asyncio: 8, 'read', 'f'

0 commit comments

Comments
 (0)