Skip to content

Commit

Permalink
fix: fixed typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Dec 6, 2020
1 parent b2e7985 commit 74db79f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test:
pytest -s -vv tests/test_requestqueue.py

typecheck:
MYPYPATH="${MYPYPATH}:../aw-core" mypy aw_client
MYPYPATH="${MYPYPATH}:../aw-core" mypy

clean:
rm -rf build dist
Expand Down
4 changes: 2 additions & 2 deletions examples/redact_sensitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def _redact_event(e: Event, pattern: Union[str, Pattern]) -> Event:
return e


def _find_sensitive(el: List[Event], pattern: Union[str, Pattern]) -> Set[int]:
sensitive_ids: Set[int] = set()
def _find_sensitive(el: List[Event], pattern: Union[str, Pattern]) -> Set:
sensitive_ids = set()
for e in el:
if _check_event(e, pattern):
sensitive_ids.add(e.id)
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[mypy]
files = aw-client/**.py, test/**.py, examples/**.py
files = aw_client, tests, examples
ignore_missing_imports = true
check_untyped_defs = true
8 changes: 4 additions & 4 deletions tests/test_requestqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def _post(self, *args, **kwargs):

def test_basic():
client = MockClient()
rq = RequestQueue(client)
rq = RequestQueue(client) # type: ignore

# Mockeypatching
rq._try_connect = lambda: True
rq._try_connect = lambda: True # type: ignore
rq.connected = True

rq.start()
Expand All @@ -51,10 +51,10 @@ def test_basic():

def test_complex():
client = MockClient()
rq = RequestQueue(client)
rq = RequestQueue(client) # type: ignore

# Mockeypatching
rq._try_connect = lambda: False
rq._try_connect = lambda: False # type: ignore

rq.start()
sleep(1)
Expand Down

0 comments on commit 74db79f

Please sign in to comment.