Title: Bug with patch and mypy · Issue #4263 · python/typeshed · GitHub
Open Graph Title: Bug with patch and mypy · Issue #4263 · python/typeshed
X Title: Bug with patch and mypy · Issue #4263 · python/typeshed
Description: 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...
Open Graph Description: 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_vali...
X Description: 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_vali...
Opengraph URL: https://github.com/python/typeshed/issues/4263
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug with patch and mypy","articleBody":"```\r\nfrom unittest.mock import Mock\r\nfrom unittest.mock import patch\r\n\r\nimport click.testing\r\nimport pytest\r\nfrom pytest_mock import MockFixture\r\n\r\nfrom irpf_cei import __main__\r\n\r\n@pytest.fixture\r\ndef mock_cei_validate_header(mocker: MockFixture) -> Mock:\r\n \"\"\"Fixture for mocking cei.validate.\"\"\"\r\n mock = mocker.patch(\"irpf_cei.cei.validate_header\")\r\n mock.return_value = 2019, \"ABC\"\r\n return mock\r\n```\r\n\r\nWhen I check the code above I get:\r\n\r\n```\r\nerror: Returning Any from function declared to return \"Mock\" \r\n[no-any-return]\r\n return mock\r\n```\r\n\r\nBut I expect Mock from patch. I worked in previous versions.","author":{"url":"https://github.com/staticdev","@type":"Person","name":"staticdev"},"datePublished":"2020-06-25T13:31:01Z","url":"https://github.com/python/typeshed/issues/4263"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:386721df-c1c1-15ce-2613-1769c5111375 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96D0:1BCD46:6473DF:86A9C9:6B00364D |
| html-safe-nonce | 68549277e31af79300b681aa2433a254842df17bd9ea3f63b3c5f1ff194fcd37 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkQwOjFCQ0Q0Njo2NDczREY6ODZBOUM5OjZCMDAzNjREIiwidmlzaXRvcl9pZCI6IjEyNjQ4NzM3ODQ2MzcxNDI2MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1c87ba5b1a837097ab004c3cf40cc1e7612ea04e320134347832d8d0cb63ed35 |
| hovercard-subject-tag | issue:645565100 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/4263/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b38c15ad88de0bc814c4fe45c9ed73257658579e89a4d465a15d93d72241ccc/python/typeshed/issues/4263 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b38c15ad88de0bc814c4fe45c9ed73257658579e89a4d465a15d93d72241ccc/python/typeshed/issues/4263 |
| og:image:alt | 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_vali... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | staticdev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width