Skip to content

Commit

Permalink
Merge pull request #2702 from tdadela/annotate_a_few_functions
Browse files Browse the repository at this point in the history
annotate return types of a few functions to enable more mypy check
  • Loading branch information
cyberw committed May 5, 2024
2 parents 06b2274 + 3abbf03 commit e290263
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class FastHttpUser(User):

_callstack_regex = re.compile(r' File "(\/.[^"]*)", line (\d*),(.*)')

def __init__(self, environment):
def __init__(self, environment) -> None:
super().__init__(environment)
if self.host is None:
raise LocustError(
Expand Down
4 changes: 2 additions & 2 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def user_count(self) -> int:


class WorkerNodes(MutableMapping):
def __init__(self):
def __init__(self) -> None:
self._worker_nodes: dict[str, WorkerNode] = {}

def get_by_state(self, state) -> list[WorkerNode]:
Expand Down Expand Up @@ -648,7 +648,7 @@ class MasterRunner(DistributedRunner):
:class:`WorkerRunners <WorkerRunner>` will aggregated.
"""

def __init__(self, environment, master_bind_host, master_bind_port):
def __init__(self, environment, master_bind_host, master_bind_port) -> None:
"""
:param environment: Environment instance
:param master_bind_host: Host/interface to use for incoming worker connections
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ commands =

[testenv:mypy]
deps =
mypy==1.9.0
mypy==1.10.0
types-requests
commands = mypy locust/

0 comments on commit e290263

Please sign in to comment.