From 78642b5267fa89105e57c7f3fe0a593da3d8e35d Mon Sep 17 00:00:00 2001 From: qlrd Date: Sun, 31 Dec 2023 19:55:23 -0300 Subject: [PATCH] added some lint to tests/conftest.py --- tests/conftest.py | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index e94a35f34..c3408dfec 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,6 +9,10 @@ def reset_krux_modules(): + """ + Delete all related krux modules that + the current shell has imported + """ import sys for name in list(sys.modules.keys()): @@ -18,6 +22,13 @@ def reset_krux_modules(): @pytest.fixture def mp_modules(mocker, monkeypatch): + """ + Suppress the default behavior of some modules + without changing its original source code. + + :param mocker: the mocker + :param monkeypatch: the monkey patcher + """ from embit.util import secp256k1 import random import time @@ -49,7 +60,15 @@ def mp_modules(mocker, monkeypatch): @pytest.fixture -def m5stickv(monkeypatch, mp_modules): +# pylint: disable=unused-argument +def m5stickv(monkeypatch, mp_modules): # pylint: disable=redefined-outer-name + """ + Suppress the default behavior of :module:`board` + for m5stickV device + + :param monkeypatch: the monkey patcher + :param mp_modules: the mp_modules function + """ import sys monkeypatch.setitem(sys.modules, "board", board_m5stickv()) @@ -57,7 +76,15 @@ def m5stickv(monkeypatch, mp_modules): @pytest.fixture -def amigo_tft(monkeypatch, mp_modules): +# pylint: disable=unused-argument +def amigo_tft(monkeypatch, mp_modules): # pylint: disable=redefined-outer-name + """ + Suppress the default behavior of :module:`board` + for amigo_tft device + + :param monkeypatch: the monkey patcher + :param mp_modules: the mp_modules function + """ import sys monkeypatch.setitem(sys.modules, "board", board_amigo_tft()) @@ -65,7 +92,15 @@ def amigo_tft(monkeypatch, mp_modules): @pytest.fixture -def dock(monkeypatch, mp_modules): +# pylint: disable=unused-argument +def dock(monkeypatch, mp_modules): # pylint: disable=redefined-outer-name + """ + Suppress the default behavior of :module:`board` + for dock device + + :param monkeypatch: the monkey patcher + :param mp_modules: the mp_modules function + """ import sys monkeypatch.setitem(sys.modules, "board", board_dock())