Skip to content

Commit

Permalink
feat(conftest): Added root level conftest file
Browse files Browse the repository at this point in the history
Added the conftest.py file at root level of repo, the fixture
and configuratuions can be used all over repo.
  • Loading branch information
hrushikesh430 committed Dec 23, 2024
1 parent 57c8917 commit f1c2cb1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=W0621 # redefined-outer-name
#
# IDF is using [pytest](https://github.com/pytest-dev/pytest) and
# [pytest-embedded plugin](https://github.com/espressif/pytest-embedded) as its test framework.
#
# if you found any bug or have any question,
# please report to https://github.com/espressif/pytest-embedded/issues
# or discuss at https://github.com/espressif/pytest-embedded/discussions
import logging
import os

import pytest
from _pytest.fixtures import FixtureRequest
from pytest_embedded.plugin import multi_dut_fixture

@pytest.fixture
@multi_dut_fixture
def build_dir(target: str, config: str) -> str:
return f'build_{target}_{config}'

@pytest.fixture
@multi_dut_fixture
def config(request: FixtureRequest) -> str:
return getattr(request, 'param', None) or "default"

0 comments on commit f1c2cb1

Please sign in to comment.