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

Add overloads to MockRouter.__call__ #187

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

flaeppe
Copy link
Contributor

@flaeppe flaeppe commented Nov 12, 2021

  • Resolves an [union-attr] error shown when calling MockRouter methods

Repro:

import respx
mocker = respx.mock()
mocker.get(path="http://localhost/")

Results in an error:

error: Item "function" of "Union[MockRouter, Callable[..., Any]]" has no attribute "get"  [union-attr]

- Resolves an attribute error shown when calling MockRouter methods
@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2021

Codecov Report

Merging #187 (6491c5c) into master (8511566) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #187   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines         2712      2716    +4     
  Branches       289       289           
=========================================
+ Hits          2712      2716    +4     
Impacted Files Coverage Δ
respx/router.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8511566...6491c5c. Read the comment docs.

Copy link
Owner

@lundberg lundberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! This will please mypy 👍

@lundberg lundberg merged commit 8cc098f into lundberg:master Nov 12, 2021
@flaeppe flaeppe deleted the fix/mock-router-call-typing branch November 15, 2021 19:50
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

Successfully merging this pull request may close these issues.

3 participants