8000 TEST: Add xfailing test for [func-returns-value] by harahu · Pull Request #17834 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

TEST: Add xfailing test for [func-returns-value] #17834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test-data/unit/check-expressions.test
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,36 @@ f() and b # E: "f&qu 9AF4 ot; does not return a value (it only ever returns None)
b or f() # E: "f" does not return a value (it only ever returns None)
[builtins fixtures/bool.pyi]

[case testNoneReturnWithDecorators-xfail]
# See: https://github.com/python/mypy/issues/14179
from typing import Callable, TypeVar

F = TypeVar('F', bound=Callable)

def deco(f: F) -> F:
pass

@deco
@deco
def f() -> None:
pass

y1 = f() # E: "f" does not return a value (it only ever returns None)

class A:
@staticmethod
def g() -> None: pass

y2 = A.g() # E: "g" of "A" does not return a value (it only ever returns None)
y3 = A().g() # E: "g" of "A" does not return a value (it only ever returns None)
[builtins fixtures/staticmethod.pyi]

[case testNoneReturnWithCallable-xfail]
class A:
def __call__(self) -> None: pass

y = A()() # E: Function does not return a value (it only ever returns None)


-- Slicing
-- -------
Expand Down
Loading
0