Repository: ClearcodeHQ/pytest-rabbitmq (language: python)

Issue:
Review typing
And run mypy check


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index 3704c8e..8330841 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -11,3 +11,4 @@ jobs:
     with:
       black: true
       ruff: true
+      mypy: true
diff --git a/MANIFEST.in b/MANIFEST.in
index 4e61adf..3560ca5 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,3 @@
-include *.rst
+include *.rst pytest_rabbitmq/py.typed
 recursive-include pytest_rabbitmq/*.py
 prune tests/
diff --git a/Pipfile b/Pipfile
index a94aef0..f0d89c4 100644
--- a/Pipfile
+++ b/Pipfile
@@ -15,6 +15,7 @@ pytest-cov = "==4.1.0"
 pytest-xdist = "==3.3.1"
 black = "==23.3.0"
 ruff = "==0.0.272"
+mypy = "==1.3.0"
 
 [requires]
 python_version = "3.9"
diff --git a/Pipfile.lock b/Pipfile.lock
index 9d6e788..42700dc 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "f87e92908c291d0deca48ae32ab1ed2a5307678fe5e1e44391dae945846665ff"
+            "sha256": "2022ee88dde53b2cf7591986f465688a6fe81d0037325c8f8d2081a6c97f5468"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -16,14 +16,6 @@
         ]
     },
     "default": {
-        "exceptiongroup": {
-            "hashes": [
-                "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e",
-                "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"
-            ],
-            "markers": "python_version < '3.11'",
-            "version": "==1.1.1"
-        },
         "iniconfig": {
             "hashes": [
                 "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3",
@@ -99,14 +91,6 @@
             ],
             "index": "pypi",
             "version": "==7.3.1"
-        },
-        "tomli": {
-            "hashes": [
-                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
-                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
-            ],
-            "markers": "python_version < '3.11'",
-            "version": "==2.0.1"
         }
     },
     "develop": {
@@ -224,14 +208,6 @@
             "markers": "python_version >= '3.7'",
             "version": "==7.2.7"
         },
-        "exceptiongroup": {
-            "hashes": [
-                "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e",
-                "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"
-            ],
-            "markers": "python_version < '3.11'",
-            "version": "==1.1.1"
-        },
         "execnet": {
             "hashes": [
                 "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5",
@@ -240,14 +216,6 @@
             "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
             "version": "==1.9.0"
         },
-        "importlib-resources": {
-            "hashes": [
-                "sha256:4be82589bf5c1d7999aedf2a45159d10cb3ca4f19b2271f8792bc8e6da7b22f6",
-                "sha256:7b1deeebbf351c7578e09bf2f63fa2ce8b5ffec296e0d349139d43cca061a81a"
-            ],
-            "markers": "python_version < '3.10'",
-            "version": "==5.12.0"
-        },
         "incremental": {
             "hashes": [
                 "sha256:912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0",
@@ -327,6 +295,38 @@
             "markers": "python_version >= '3.7'",
             "version": "==2.1.3"
         },
+        "mypy": {
+            "hashes": [
+                "sha256:1c4c42c60a8103ead4c1c060ac3cdd3ff01e18fddce6f1016e08939647a0e703",
+                "sha256:44797d031a41516fcf5cbfa652265bb994e53e51994c1bd649ffcd0c3a7eccbf",
+                "sha256:473117e310febe632ddf10e745a355714e771ffe534f06db40702775056614c4",
+                "sha256:4c99c3ecf223cf2952638da9cd82793d8f3c0c5fa8b6ae2b2d9ed1e1ff51ba85",
+                "sha256:550a8b3a19bb6589679a7c3c31f64312e7ff482a816c96e0cecec9ad3a7564dd",
+                "sha256:658fe7b674769a0770d4b26cb4d6f005e88a442fe82446f020be8e5f5efb2fae",
+                "sha256:6e33bb8b2613614a33dff70565f4c803f889ebd2f859466e42b46e1df76018dd",
+                "sha256:6e42d29e324cdda61daaec2336c42512e59c7c375340bd202efa1fe0f7b8f8ca",
+                "sha256:74bc9b6e0e79808bf8678d7678b2ae3736ea72d56eede3820bd3849823e7f305",
+                "sha256:76ec771e2342f1b558c36d49900dfe81d140361dd0d2df6cd71b3db1be155409",
+                "sha256:7d23370d2a6b7a71dc65d1266f9a34e4cde9e8e21511322415db4b26f46f6b8c",
+                "sha256:87df44954c31d86df96c8bd6e80dfcd773473e877ac6176a8e29898bfb3501cb",
+                "sha256:8c5979d0deb27e0f4479bee18ea0f83732a893e81b78e62e2dda3e7e518c92ee",
+                "sha256:95d8d31a7713510685b05fbb18d6ac287a56c8f6554d88c19e73f724a445448a",
+                "sha256:a22435632710a4fcf8acf86cbd0d69f68ac389a3892cb23fbad176d1cddaf228",
+                "sha256:a8763e72d5d9574d45ce5881962bc8e9046bf7b375b0abf031f3e6811732a897",
+                "sha256:c1eb485cea53f4f5284e5baf92902cd0088b24984f4209e25981cc359d64448d",
+                "sha256:c5d2cc54175bab47011b09688b418db71403aefad07cbcd62d44010543fc143f",
+                "sha256:cbc07246253b9e3d7d74c9ff948cd0fd7a71afcc2b77c7f0a59c26e9395cb152",
+                "sha256:d0b6c62206e04061e27009481cb0ec966f7d6172b5b936f3ead3d74f29fe3dcf",
+                "sha256:ddae0f39ca146972ff6bb4399f3b2943884a774b8771ea0a8f50e971f5ea5ba8",
+                "sha256:e1f4d16e296f5135624b34e8fb741eb0eadedca90862405b1f1fde2040b9bd11",
+                "sha256:e86c2c6852f62f8f2b24cb7a613ebe8e0c7dc1402c61d36a609174f63e0ff017",
+                "sha256:ebc95f8386314272bbc817026f8ce8f4f0d2ef7ae44f947c4664efac9adec929",
+                "sha256:f9dca1e257d4cc129517779226753dbefb4f2266c4eaad610fc15c6a7e14283e",
+                "sha256:faff86aa10c1aa4a10e1a301de160f3d8fc8703b88c7e98de46b531ff1276a9a"
+            ],
+            "index": "pypi",
+            "version": "==1.3.0"
+        },
         "mypy-extensions": {
             "hashes": [
                 "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d",
@@ -353,11 +353,11 @@
         },
         "platformdirs": {
             "hashes": [
-                "sha256:412dae91f52a6f84830f39a8078cecd0e866cb72294a5c66808e74d5e88d251f",
-                "sha256:e2378146f1964972c03c085bb5662ae80b2b8c06226c54b2ff4aa9483e8a13a5"
+                "sha256:0ade98a4895e87dc51d47151f7d2ec290365a585151d97b4d8d6312ed6132fed",
+                "sha256:e48fabd87db8f3a7df7150a4a5ea22c546ee8bc39bc2473244730d4b56d2cc4e"
             ],
             "markers": "python_version >= '3.7'",
-            "version": "==3.5.1"
+            "version": "==3.5.3"
         },
         "pluggy": {
             "hashes": [
@@ -414,14 +414,6 @@
             "index": "pypi",
             "version": "==0.0.272"
         },
-        "tomli": {
-            "hashes": [
-                "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
-                "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"
-            ],
-            "markers": "python_version < '3.11'",
-            "version": "==2.0.1"
-        },
         "towncrier": {
             "hashes": [
                 "sha256:da552f29192b3c2b04d630133f194c98e9f14f0558669d427708e203fea4d0a5",
@@ -435,16 +427,8 @@
                 "sha256:88a4153d8505aabbb4e13aacb7c486c2b4a33ca3b3f807914a9b4c844c471c26",
                 "sha256:d91d5919357fe7f681a9f2b5b4cb2a5f1ef0a1e9f59c4d8ff0d3491e05c0ffd5"
             ],
-            "markers": "python_version < '3.10'",
+            "markers": "python_version >= '3.7'",
             "version": "==4.6.3"
-        },
-        "zipp": {
-            "hashes": [
-                "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b",
-                "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"
-            ],
-            "markers": "python_version < '3.10'",
-            "version": "==3.15.0"
         }
     }
 }
diff --git a/mypy.ini b/mypy.ini
new file mode 100644
index 0000000..e87fc3e
--- /dev/null
+++ b/mypy.ini
@@ -0,0 +1,23 @@
+[mypy]
+allow_redefinition = False
+allow_untyped_globals = False
+check_untyped_defs = True
+disallow_incomplete_defs = True
+disallow_subclassing_any = True
+disallow_untyped_calls = True
+disallow_untyped_decorators = True
+disallow_untyped_defs = True
+follow_imports = silent
+ignore_missing_imports = False
+implicit_reexport = False
+no_implicit_optional = True
+pretty = True
+show_error_codes = True
+strict_equality = True
+warn_no_return = True
+warn_return_any = True
+warn_unreachable = True
+warn_unused_ignores = True
+
+[mypy-pika.*]
+ignore_missing_imports = True
\ No newline at end of file
diff --git a/newsfragments/324.break.rst b/newsfragments/324.break.rst
new file mode 100644
index 0000000..0f4b94f
--- /dev/null
+++ b/newsfragments/324.break.rst
@@ -0,0 +1,1 @@
+Dropped support for Python 3.7
\ No newline at end of file
diff --git a/newsfragments/324.feature.rst b/newsfragments/324.feature.rst
new file mode 100644
index 0000000..e986c3e
--- /dev/null
+++ b/newsfragments/324.feature.rst
@@ -0,0 +1,1 @@
+Introduce typing and run mypy checks
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d556991..7d2e358 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,7 +33,7 @@ dependencies = [
     "mirakuru",
     "pika",
 ]
-requires-python = ">= 3.7"
+requires-python = ">= 3.8"
 
 [project.urls]
 "Source" = "https://github.com/ClearcodeHQ/pytest-rabbitmq"


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 7c7bbfc..32dde3d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -16,7 +16,7 @@ jobs:
     strategy:
       fail-fast: true
       matrix:
-        python-version: [3.7, 3.8, 3.9, "3.10", "3.11", pypy-3.8]
+        python-version: [3.8, 3.9, "3.10", "3.11", pypy-3.8]
     env:
       OS: ubuntu-latest
       PYTHON: ${{ matrix.python-version }}
diff --git a/pytest_rabbitmq/factories/client.py b/pytest_rabbitmq/factories/client.py
index 453e23c..255b0c5 100644
--- a/pytest_rabbitmq/factories/client.py
+++ b/pytest_rabbitmq/factories/client.py
@@ -17,17 +17,20 @@
 # along with pytest-rabbitmq.  If not, see <http://www.gnu.org/licenses/>.
 """RabbitMQ client fixture factory."""
 import logging
+from typing import Callable, Generator
 
 import pytest
-from pika import ConnectionParameters
-from pika.adapters.blocking_connection import BlockingConnection
+from pika import BlockingConnection, ConnectionParameters
 from pika.credentials import PlainCredentials
 from pika.exceptions import ChannelClosed
+from pytest import FixtureRequest
+
+from pytest_rabbitmq.factories.executor import RabbitMqExecutor
 
 logger = logging.getLogger("pytest-rabbitmq")
 
 
-def clear_rabbitmq(process, rabbitmq_connection):
+def clear_rabbitmq(process: RabbitMqExecutor, rabbitmq_connection: BlockingConnection) -> None:
     """Clear queues and exchanges from given rabbitmq process.
 
     :param RabbitMqExecutor process: rabbitmq process
@@ -65,7 +68,10 @@ def clear_rabbitmq(process, rabbitmq_connection):
         channel.queue_delete(queue_name)
 
 
-def rabbitmq(process_fixture_name, teardown=clear_rabbitmq):
+def rabbitmq(
+    process_fixture_name: str,
+    teardown: Callable[[RabbitMqExecutor, BlockingConnection], None] = clear_rabbitmq,
+) -> Callable[[FixtureRequest], Generator[BlockingConnection, None, None]]:
     """Client fixture factory for RabbitMQ.
 
     :param str process_fixture_name: name of RabbitMQ process variable
@@ -83,7 +89,7 @@ def rabbitmq(process_fixture_name, teardown=clear_rabbitmq):
     """
 
     @pytest.fixture
-    def rabbitmq_factory(request):
+    def rabbitmq_factory(request: FixtureRequest) -> Generator[BlockingConnection, None, None]:
         """Client fixture for RabbitMQ.
 
         #. Get module and config.
diff --git a/pytest_rabbitmq/factories/executor.py b/pytest_rabbitmq/factories/executor.py
index 18929b7..1a1087c 100644
--- a/pytest_rabbitmq/factories/executor.py
+++ b/pytest_rabbitmq/factories/executor.py
@@ -1,6 +1,7 @@
 """RabbitMQ Executor."""
 import re
 import subprocess
+from typing import List, Optional
 
 from mirakuru import TCPExecutor
 
@@ -12,21 +13,20 @@ class RabbitMqExecutor(TCPExecutor):
 
     def __init__(
         self,
-        command,
-        host,
-        port,
-        rabbit_ctl,
-        logpath,
-        path,
-        plugin_path,
-        node_name=None,
-        **kwargs,
-    ):  # pylint:disable=too-many-arguments
+        command: str,
+        host: str,
+        port: int,
+        rabbit_ctl: str,
+        logpath: str,
+        path: str,
+        plugin_path: str,
+        node_name: Optional[str] = None,
+    ) -> None:  # pylint:disable=too-many-arguments
         """Initialize RabbitMQ executor.
 
-        :param str command: rabbitmq-server location
-        :param str host: host where rabbitmq will be accessible
-        :param int port: port under which rabbitmq runs
+        :param command: rabbitmq-server location
+        :param host: host where rabbitmq will be accessible
+        :param port: port under which rabbitmq runs
         :param str rabbit_ctl: rabbitctl location
         :param str logpath:
         :param str path: Path containing rabbitmq'a mnesia na plugins
@@ -42,21 +42,21 @@ def __init__(
             # at different ports will work separately instead of clustering.
             "RABBITMQ_NODENAME": node_name or f"rabbitmq-test-{port}",
         }
-        super().__init__(command, host, port, timeout=60, envvars=envvars, **kwargs)
+        super().__init__(command, host, port, timeout=60, envvars=envvars)
         self.rabbit_ctl = rabbit_ctl
 
-    def rabbitctl_output(self, *args):
+    def rabbitctl_output(self, *args: str) -> str:
         """Query rabbitctl with args.
 
         :param list args: list of additional args to query
         """
-        ctl_command = [self.rabbit_ctl]
+        ctl_command: List[str] = [self.rabbit_ctl]
         ctl_command.extend(args)
         return subprocess.check_output(ctl_command, env=self._popen_kwargs["env"]).decode("utf-8")
 
-    def list_exchanges(self):
+    def list_exchanges(self) -> List[str]:
         """Get exchanges defined on given rabbitmq."""
-        exchanges = []
+        exchanges: List[str] = []
         output = self.rabbitctl_output("list_exchanges", "name")
         unwanted_exchanges = ["Listing exchanges for vhost / ...", "...done."]
 
@@ -66,9 +66,9 @@ def list_exchanges(self):
 
         return exchanges
 
-    def list_queues(self):
+    def list_queues(self) -> List[str]:
         """Get queues defined on given rabbitmq."""
-        queues = []
+        queues: List[str] = []
         output = self.rabbitctl_output("list_queues", "name")
 
         for queue in output.split("\n"):
diff --git a/pytest_rabbitmq/factories/process.py b/pytest_rabbitmq/factories/process.py
index 3212126..b12371d 100644
--- a/pytest_rabbitmq/factories/process.py
+++ b/pytest_rabbitmq/factories/process.py
@@ -19,34 +19,57 @@
 
 import os
 from tempfile import gettempdir
+from typing import Any, Callable, Generator, Optional, TypedDict
 
 import pytest
 from mirakuru.exceptions import ProcessExitedWithError
 from port_for import get_port
+from pytest import FixtureRequest
 
 from pytest_rabbitmq.factories.executor import RabbitMqExecutor
 
 
-def get_config(request):
+class RabbitMQConfig(TypedDict):
+    """Pytest RabbitMQ config definition type."""
+
+    host: str
+    port: Optional[int]
+    logsdir: str
+    server: str
+    ctl: str
+    node: str
+    plugindir: str
+
+
+def get_config(request: FixtureRequest) -> RabbitMQConfig:
     """Return a dictionary with config options."""
-    config = {}
-    options = ["logsdir", "host", "port", "server", "ctl", "node", "plugindir"]
-    for option in options:
+
+    def get_conf_option(option: str) -> Any:
         option_name = "rabbitmq_" + option
-        conf = request.config.getoption(option_name) or request.config.getini(option_name)
-        config[option] = conf
+        return request.config.getoption(option_name) or request.config.getini(option_name)
+
+    port = get_conf_option("port")
+    config: RabbitMQConfig = {
+        "host": get_conf_option("host"),
+        "port": int(port) if port else None,
+        "logsdir": get_conf_option("logsdir"),
+        "server": get_conf_option("server"),
+        "ctl": get_conf_option("ctl"),
+        "node": get_conf_option("node"),
+        "plugindir": get_conf_option("plugindir"),
+    }
     return config
 
 
 def rabbitmq_proc(
-    server=None,
-    host=None,
-    port=-1,
-    node=None,
-    ctl=None,
-    logsdir=None,
-    plugindir=None,
-):
+    server: Optional[str] = None,
+    host: Optional[str] = None,
+    port: Optional[int] = -1,
+    node: Optional[str] = None,
+    ctl: Optional[str] = None,
+    logsdir: Optional[str] = None,
+    plugindir: Optional[str] = None,
+) -> Callable[[FixtureRequest], Generator[RabbitMqExecutor, None, None]]:
     """Fixture factory for RabbitMQ process.
 
     :param str server: path to rabbitmq-server command
@@ -68,7 +91,7 @@ def rabbitmq_proc(
     """
 
     @pytest.fixture(scope="session")
-    def rabbitmq_proc_fixture(request):
+    def rabbitmq_proc_fixture(request: FixtureRequest) -> Generator[RabbitMqExecutor, None, None]:
         """Fixture for RabbitMQ process.
 
         #. Get config.
@@ -92,16 +115,20 @@ def rabbitmq_proc_fixture(request):
         rabbit_server = server or config["server"]
         rabbit_host = host or config["host"]
         rabbit_port = get_port(port) or get_port(config["port"])
+        assert rabbit_port
 
         rabbit_path = os.path.join(gettempdir(), f"rabbitmq.{rabbit_port}/")
         rabbit_plugin_path = plugindir or config["plugindir"] or rabbit_path
 
+        rabbit_logpath = config["logsdir"] or logsdir
+        assert rabbit_logpath
+
         rabbit_executor = RabbitMqExecutor(
             rabbit_server,
             rabbit_host,
             rabbit_port,
             rabbit_ctl,
-            logpath=config["logsdir"] or logsdir,
+            logpath=rabbit_logpath,
             path=rabbit_path,
             plugin_path=rabbit_plugin_path,
             node_name=node or config["node"],
diff --git a/pytest_rabbitmq/plugin.py b/pytest_rabbitmq/plugin.py
index 49a4541..d1e43ea 100644
--- a/pytest_rabbitmq/plugin.py
+++ b/pytest_rabbitmq/plugin.py
@@ -18,6 +18,8 @@
 """Plugin definition for pytest-rabbitmq."""
 from tempfile import gettempdir
 
+from pytest import Parser
+
 from pytest_rabbitmq import factories
 
 # pylint:disable=invalid-name
@@ -30,7 +32,7 @@
 _help_node = "Node name for rabbitmq instance"
 
 
-def pytest_addoption(parser):
+def pytest_addoption(parser: Parser) -> None:
     """Confioguration option."""
     parser.addini(name="rabbitmq_host", help=_help_host, default="127.0.0.1")
     parser.addini(
diff --git a/pytest_rabbitmq/py.typed b/pytest_rabbitmq/py.typed
new file mode 100644
index 0000000..e69de29
diff --git a/tests/test_rabbitmq.py b/tests/test_rabbitmq.py
index 7064877..153874e 100644
--- a/tests/test_rabbitmq.py
+++ b/tests/test_rabbitmq.py
@@ -1,15 +1,17 @@
 """Tests for RabbitMQ fixtures."""
+from pika import BlockingConnection
 
 from pytest_rabbitmq.factories.client import clear_rabbitmq
+from pytest_rabbitmq.factories.executor import RabbitMqExecutor
 
 
-def test_rabbitmq(rabbitmq):
+def test_rabbitmq(rabbitmq: BlockingConnection) -> None:
     """Check a signle. default rabbitmq."""
     channel = rabbitmq.channel()
     assert channel.is_open
 
 
-def test_second_rabbitmq(rabbitmq, rabbitmq2):
+def test_second_rabbitmq(rabbitmq: BlockingConnection, rabbitmq2: BlockingConnection) -> None:
     """Check whether two rabbitmq are started correctly."""
     print("checking first channel")
     channel = rabbitmq.channel()
@@ -20,7 +22,9 @@ def test_second_rabbitmq(rabbitmq, rabbitmq2):
     assert channel2.is_open
 
 
-def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
+def test_rabbitmq_clear_exchanges(
+    rabbitmq: BlockingConnection, rabbitmq_proc: RabbitMqExecutor
+) -> None:
     """Declare exchange, and clear it by clear_rabbitmq."""
     channel = rabbitmq.channel()
     assert channel.is_open
@@ -41,7 +45,9 @@ def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
     assert no_exchanges == cleared_exchanges
 
 
-def test_rabbitmq_clear_queues(rabbitmq, rabbitmq_proc):
+def test_rabbitmq_clear_queues(
+    rabbitmq: BlockingConnection, rabbitmq_proc: RabbitMqExecutor
+) -> None:
     """Declare queue, and clear it by clear_rabbitmq."""
     channel = rabbitmq.channel()
     assert channel.is_open
@@ -64,13 +70,15 @@ def test_rabbitmq_clear_queues(rabbitmq, rabbitmq_proc):
     assert no_queues == cleared_queues
 
 
-def test_random_port(rabbitmq_rand):
+def test_random_port(rabbitmq_rand: BlockingConnection) -> None:
     """Test if rabbit fixture can be started on random port."""
     channel = rabbitmq_rand.channel()
     assert channel.is_open
 
 
-def test_random_port_node_names(rabbitmq_rand_proc2, rabbitmq_rand_proc3):
+def test_random_port_node_names(
+    rabbitmq_rand_proc2: RabbitMqExecutor, rabbitmq_rand_proc3: RabbitMqExecutor
+) -> None:
     """Test node names for different processes."""
     # pylint:disable=protected-access
     assert (
@@ -80,7 +88,7 @@ def test_random_port_node_names(rabbitmq_rand_proc2, rabbitmq_rand_proc3):
     # pylint:enable=protected-access
 
 
-def test_plugin_directory(rabbitmq_plugindir):
+def test_plugin_directory(rabbitmq_plugindir: RabbitMqExecutor) -> None:
     """Test node names for different processes."""
     # pylint:disable=protected-access
     assert rabbitmq_plugindir._envvars["RABBITMQ_ENABLED_PLUGINS_FILE"] == "/etc/plugins"