From 4a2f3f0b0ff4270e2757a8d3ed07f780c4f01656 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 bbb9ed37f..4bbc72fb9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,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()): @@ -19,6 +23,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 @@ -50,7 +61,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()) @@ -58,7 +77,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()) @@ -66,7 +93,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())