responses 0.21.0 broke mypy check
See original GitHub issueDescribe the bug
We use response in our tests, and from responses 0.21.0 we’ve got this error:
$mypy tests/test_download.py
venv/lib/python3.10/site-packages/mypy/typeshed/stdlib/unittest/mock.pyi: error: Source file found twice under different module names: "unittest.mock" and "mypy.typeshed.stdlib.unittest.mock"
Found 1 error in 1 file (errors prevented further checking)
Returning mypy version did not resolve problem, but returning responses to 0.20.0 does.
I try to find problem in your changes, and it could be probably this line in init.py:
from mypy.typeshed.stdlib.unittest.mock import _patcher as _mock_patcher
Additional context
No response
Version of responses
0.21.0
Steps to Reproduce
# content of crash.py
import responses
import unittest.mock
and than run
mypy crash.py
Expected Result
Success: no issues found in 1 source file
Actual Result
venv/lib/python3.10/site-packages/mypy/typeshed/stdlib/unittest/mock.pyi: error: Source file found twice under different module names: “unittest.mock” and “mypy.typeshed.stdlib.unittest.mock” Found 1 error in 1 file (errors prevented further checking)
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:19 (2 by maintainers)
Top Results From Across the Web
Common issues and solutions - mypy 0.991 documentation
Common issues and solutions# · Can't install mypy using pip# · No errors reported for obviously wrong code# · Spurious errors and locally...
Read more >httpx · PyPI
The 0.21.0 release integrates against a newly redesigned httpcore backend. ... The response.has_redirect_location location may be used to determine ...
Read more >Release Notes - FastAPI - tiangolo
Upgrade mypy and tweak internal type annotations. PR #5398 by @tiangolo. Update test dependencies, upgrade Pytest, move dependencies from dev to test.
Read more >Release Notes - Numba - PyData |
Leonardo Uieda fixed a broken link to the NumPy ufunc signature docs in #5963. Lucio Fernandez-Arjona added mypy to CI and started adding...
Read more >What's New - Xarray
Added test for DataArray attrs deepcopy recursion/nested attrs. ... Fix Mapping argument typing to allow mypy to pass on str keys (PR5690).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@markstory Experiencing the same issue when trying to upgrade
responses
in a Rasa private repo - could you please let us know about timeline for a new release (micro or minor) now that the PR with the fix got merged?@beliaev-maksim
With
responses = {git = "https://github.com/getsentry/responses.git", rev = "master"}
in pyproject.toml:Looks like it’s fixed in master! 🎉