Skip to content

Commit

Permalink
remove open() pythoneval test (python#8908)
Browse files Browse the repository at this point in the history
python/typeshed#3371 causes this to produce a different error message. open()
with no arguments doesn't seem like an important use case, so testing for it
explicitly in pythoneval isn't all that useful.
  • Loading branch information
JelleZijlstra authored May 28, 2020
1 parent 07c9f6f commit e80585a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,14 @@ _program.py:3: note: Revealed type is 'typing.BinaryIO'
_program.py:5: note: Revealed type is 'typing.IO[Any]'

[case testOpenReturnTypeInferenceSpecialCases]
reveal_type(open())
reveal_type(open(mode='rb', file='x'))
reveal_type(open(file='x', mode='rb'))
mode = 'rb'
reveal_type(open(mode=mode, file='r'))
[out]
_testOpenReturnTypeInferenceSpecialCases.py:1: error: Too few arguments for "open"
_testOpenReturnTypeInferenceSpecialCases.py:1: note: Revealed type is 'typing.TextIO'
_testOpenReturnTypeInferenceSpecialCases.py:1: note: Revealed type is 'typing.BinaryIO'
_testOpenReturnTypeInferenceSpecialCases.py:2: note: Revealed type is 'typing.BinaryIO'
_testOpenReturnTypeInferenceSpecialCases.py:3: note: Revealed type is 'typing.BinaryIO'
_testOpenReturnTypeInferenceSpecialCases.py:5: note: Revealed type is 'typing.IO[Any]'
_testOpenReturnTypeInferenceSpecialCases.py:4: note: Revealed type is 'typing.IO[Any]'

[case testPathOpenReturnTypeInference]
from pathlib import Path
Expand Down

0 comments on commit e80585a

Please sign in to comment.