Skip to content

Commit

Permalink
Merge pull request #221 from brunns/220-fix-broken-build
Browse files Browse the repository at this point in the history
Fix breakages due to Mypy chages
  • Loading branch information
offbyone authored Nov 14, 2022
2 parents c4b0ca7 + 2fead6c commit 8c36b75
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/hamcrest/library/collection/isdict_containing.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def describe_match(self, item: Mapping[K, V], match_description: Description) ->
else:
super().describe_match(item, match_description)

def _matching_keys(self, item):
def _matching_keys(self, item) -> MutableMapping[K, V]:
key_matches: MutableMapping[K, V] = {}
if hasmethod(item, "items"):
for key, value in item.items():
Expand Down
2 changes: 1 addition & 1 deletion tests/type-hinting/core/core/test_is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
b = 99
assert_that(a, is_(empty()))
assert_that(b, is_(empty())) # E: Cannot infer type argument 1 of "assert_that"
assert_that(b, is_(empty())) # E: Cannot infer type argument 1 of "assert_that" [misc]
2 changes: 1 addition & 1 deletion tests/type-hinting/core/test_assert_that.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
assert_that("str", instance_of(str))
assert_that(99, starts_with("str"))
out: |
main:5: error: Cannot infer type argument 1 of "assert_that"
main:5: error: Cannot infer type argument 1 of "assert_that" [misc]
2 changes: 1 addition & 1 deletion tests/type-hinting/library/collection/test_empty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from hamcrest import assert_that, is_, empty
assert_that([], empty())
assert_that(99, empty()) # E: Cannot infer type argument 1 of "assert_that"
assert_that(99, empty()) # E: Cannot infer type argument 1 of "assert_that" [misc]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
equal_to_ignoring_case(99)
out: |
main:3: note: Revealed type is "hamcrest.core.matcher.Matcher[builtins.str]"
main:5: error: Argument 1 to "equal_to_ignoring_case" has incompatible type "int"; expected "str"
main:5: error: Argument 1 to "equal_to_ignoring_case" has incompatible type "int"; expected "str" [arg-type]

0 comments on commit 8c36b75

Please sign in to comment.