Skip to content
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

Patch validation stopped working after version upgrade #9045

Closed
staticdev opened this issue Jun 25, 2020 · 3 comments
Closed

Patch validation stopped working after version upgrade #9045

staticdev opened this issue Jun 25, 2020 · 3 comments

Comments

@staticdev
Copy link

staticdev commented Jun 25, 2020

Please provide more information to help us understand the issue:

  • Are you reporting a bug, or opening a feature request? Bug
  • Please insert below the code you are checking with mypy,
    or a mock-up repro if the source is private. We would appreciate
    if you try to simplify your case to a minimal repro.
from unittest.mock import Mock
from unittest.mock import patch

import click.testing
import pytest
from pytest_mock import MockFixture

from irpf_cei import __main__

@pytest.fixture
def mock_cei_validate_header(mocker: MockFixture) -> Mock:
    """Fixture for mocking cei.validate."""
    mock = mocker.patch("irpf_cei.cei.validate_header")
    mock.return_value = 2019, "ABC"
    return mock
  • What is the actual behavior/output?
error: Returning Any from function declared to return "Mock" 
[no-any-return]
        return mock
  • What is the behavior/output you expect?

It should work since I expect a Mock from patch.

  • What are the versions of mypy and Python you are using?

v0.782 / 3.8.3

  • Do you see the same issue after installing mypy from Git master?

Didn't try.

  • What are the mypy flags you are using? (For example --strict-optional)
[mypy]
check_untyped_defs = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
no_implicit_optional = True
no_implicit_reexport = True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unreachable = True
warn_unused_configs = True
warn_unused_ignores = True

[mypy-tests.*]
disallow_untyped_decorators = False
  • If mypy crashed with a traceback, please paste
    the full traceback below.

N/A

@staticdev
Copy link
Author

It seems a fix was pushed to typeshed for this python/typeshed#3871

@hauntsaninja
Copy link
Collaborator

Yup, no actions for mypy here, we should close this in favour of python/typeshed#4263

@staticdev
Copy link
Author

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants