2022-02-11 01:58:50 -05:00
|
|
|
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
# pylint: disable=W0621 # redefined-outer-name
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from _pytest.fixtures import FixtureRequest
|
|
|
|
from _pytest.monkeypatch import MonkeyPatch
|
2022-10-03 15:44:28 -04:00
|
|
|
from test_panic_util import PanicTestDut
|
2022-02-11 01:58:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope='module')
|
|
|
|
def monkeypatch_module(request: FixtureRequest) -> MonkeyPatch:
|
|
|
|
mp = MonkeyPatch()
|
|
|
|
request.addfinalizer(mp.undo)
|
|
|
|
return mp
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope='module', autouse=True)
|
|
|
|
def replace_dut_class(monkeypatch_module: MonkeyPatch) -> None:
|
2022-10-13 23:12:28 -04:00
|
|
|
monkeypatch_module.setattr('pytest_embedded_idf.IdfDut', PanicTestDut)
|