Home
last modified time | relevance | path

Searched full:pytest (Results 1 – 25 of 151) sorted by relevance

1234567

/Zephyr-latest/scripts/tests/twister/pytest_integration/
Dtest_harness_pytest.py5 import pytest
11 from twisterlib.harness import Pytest
17 @pytest.fixture
36 @pytest.mark.parametrize('device_type', ['native', 'qemu'])
38 pytest_harness = Pytest()
43 'pytest',
44 'samples/hello/pytest',
58 pytest_harness = Pytest()
67 pytest_harness = Pytest()
77 pytest_harness = Pytest()
[all …]
/Zephyr-latest/doc/develop/test/
Dpytest.rst3 Integration with pytest test framework
6 *Please mind that integration of twister with pytest is still work in progress. Not every platform
7 type is supported in pytest (yet). If you find any issue with the integration or have an idea for
13 Pytest is a python framework that *“makes it easy to write small, readable tests, and can scale to
14 support complex functional testing for applications and libraries”* (`<https://docs.pytest.org/en/7…
15 Python is known for its free libraries and ease of using it for scripting. In addition, pytest
17 A pytest plugin ``pytest-twister-harness`` was introduced to provide an integration between pytest
18 and twister, allowing Zephyr’s community to utilize pytest functionality with keeping twister as
24 By default, there is nothing to be done to enable pytest support in twister. The plugin is
26 ``PYTHONPATH`` with path to this plugin, and then during pytest call, it appends the command with
[all …]
/Zephyr-latest/scripts/pylib/pytest-twister-harness/
DREADME.rst2 Pytest Twister harness
9 separately by pip. When Twister uses this plugin for pytest tests, it updates
10 :envvar:`PYTHONPATH` variable, and then extends pytest command by
24 ./scripts/twister -p native_sim -p qemu_x86 -T samples/subsys/testsuite/pytest/shell
27 …0dk/nrf52840 --device-testing --device-serial /dev/ttyACM0 -T samples/subsys/testsuite/pytest/shell
29 or build shell application by west and call pytest directly:
33 export PYTHONPATH=${ZEPHYR_BASE}/scripts/pylib/pytest-twister-harness/src:${PYTHONPATH}
35 cd ${ZEPHYR_BASE}/samples/subsys/testsuite/pytest/shell
39 pytest --twister-harness --device-type=native --build-dir=build -p twister_harness.plugin
43 pytest --twister-harness --device-type=qemu --build-dir=build -p twister_harness.plugin
[all …]
/Zephyr-latest/scripts/tests/twister/
Dconftest.py10 import pytest
26 @pytest.fixture(name='test_data')
28 """ Pytest fixture to load the test data directory"""
32 @pytest.fixture(name='zephyr_base')
36 @pytest.fixture(name='testsuites_dir')
38 """ Pytest fixture to load the test data directory"""
41 @pytest.fixture(name='class_env')
43 """ Pytest fixture to initialize and return the class TestPlan object"""
54 @pytest.fixture(name='class_testplan')
56 """ Pytest fixture to initialize and return the class TestPlan object"""
[all …]
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/
Dconftest.py11 import pytest
17 @pytest.fixture
23 @pytest.fixture
27 pytest.fail('Environmental variable ZEPHYR_BASE has to be set.')
32 @pytest.fixture
34 """Retrun path to pytest-twister-harness src directory"""
35 …pytest_twister_harness_path = str(Path(zephyr_base) / 'scripts' / 'pylib' / 'pytest-twister-harnes…
39 @pytest.fixture
44 @pytest.fixture
/Zephyr-latest/scripts/tests/twister_blackbox/test_data/tests/pytest/pytest/
Dconftest.py5 import pytest
8 # add option "--cmdopt" to pytest, or it will report "unknown option"
15 '--custom-pytest-arg'
20 @pytest.fixture()
24 # define fixture to return value of option "--custom-pytest-arg", this fixture
26 @pytest.fixture()
28 return request.config.getoption('--custom-pytest-arg')
/Zephyr-latest/samples/subsys/testsuite/pytest/basic/pytest/
Dconftest.py5 import pytest
8 # add option "--cmdopt" to pytest, or it will report "unknown option"
15 '--custom-pytest-arg'
20 @pytest.fixture()
24 # define fixture to return value of option "--custom-pytest-arg", this fixture
26 @pytest.fixture()
28 return request.config.getoption('--custom-pytest-arg')
/Zephyr-latest/tests/boot/with_mcumgr/
Dtestcase.yaml16 - pytest
19 harness: pytest
22 - "pytest/test_upgrade.py"
26 - pytest
29 harness: pytest
32 - "pytest/test_downgrade_prevention.py"
DREADME.rst5 using **sysbuild**. Tests are automated with pytest, a new harness of Twister
9 Pytest uses the MCUmgr fixture which requires the ``mcumgr`` available
25 Test scripts can be found in ``pytest`` directory. To list available
26 scenarios with described procedures, one can use a pytest command:
30 pytest zephyr/tests/boot/with_mcumgr/pytest --collect-only -v
/Zephyr-latest/scripts/pylib/pytest-twister-harness/src/twister_harness/
Dfixtures.py9 import pytest
22 @pytest.fixture(scope='session')
23 def twister_harness_config(request: pytest.FixtureRequest) -> TwisterHarnessConfig:
29 @pytest.fixture(scope='session')
48 @pytest.fixture(scope=determine_scope)
49 def unlaunched_dut(request: pytest.FixtureRequest, device_object: DeviceAdapter) -> Generator[Devic…
57 @pytest.fixture(scope=determine_scope)
58 def dut(request: pytest.FixtureRequest, device_object: DeviceAdapter) -> Generator[DeviceAdapter, N…
68 @pytest.fixture(scope=determine_scope)
77 pytest.fail('Prompt not found')
[all …]
/Zephyr-latest/scripts/tests/twister_blackbox/
Dconftest.py12 import pytest
32 @pytest.fixture(name='zephyr_base')
37 @pytest.fixture(name='zephyr_test_data')
41 @pytest.fixture(autouse=True)
43 # As this fixture is autouse, one can use the pytest.mark.noclearlog decorator
48 # clear_log is used by pytest fixture
53 # Required to fix the pytest logging error
54 # See: https://github.com/pytest-dev/pytest/issues/5502
67 @pytest.fixture(name='out_path', autouse=True)
69 # As this fixture is autouse, one can use the pytest.mark.noclearout decorator
Dtest_addon.py13 import pytest
35 @pytest.mark.parametrize(
57 pytest.raises(SystemExit) as sys_exit:
62 @pytest.mark.parametrize(
84 pytest.raises(SystemExit) as sys_exit:
89 @pytest.mark.parametrize(
117 pytest.raises(SystemExit) as sys_exit:
142 pytest.raises(SystemExit) as sys_exit:
172 pytest.raises(SystemExit) as sys_exit:
192 # It installs and uninstalls pytest-twister-harness using pip
[all …]
/Zephyr-latest/tests/drivers/can/host/pytest/
Dtest_can.py10 import pytest
20 @pytest.mark.parametrize('msg', [
21 pytest.param(
26 pytest.param(
32 pytest.param(
38 pytest.param(
45 pytest.param(
65 pytest.fail('no message received')
69 pytest.fail(f'rx message "{rx}" not equal to tx message "{tx}"')
76 pytest.skip('CAN FD not supported by DUT')
[all …]
Dconftest.py12 import pytest
20 """Add local parser options to pytest."""
24 @pytest.fixture(name='context', scope='session')
38 @pytest.fixture(name='chosen', scope='module')
51 pytest.fail('zephyr,canbus chosen device not found or not ready')
54 @pytest.fixture
62 @pytest.fixture
/Zephyr-latest/scripts/tests/twister_blackbox/test_data/tests/pytest/
Dtest_data.yaml2 sample.twister.pytest:
5 harness: pytest
7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."]
10 - pytest
/Zephyr-latest/samples/subsys/testsuite/pytest/basic/
Dtestcase.yaml2 sample.twister.pytest:
5 harness: pytest
7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."]
10 - pytest
/Zephyr-latest/tests/lib/devicetree/memory_region_flags/
Dtestcase.yaml4 harness: pytest
8 - pytest
11 harness: pytest
15 - pytest
/Zephyr-latest/scripts/west_commands/
Drun_tests.py8 # package. Runs mypy and pytest. Any extra arguments in sys.argv are
9 # passed along to pytest.
31 pytest = [sys.executable, '-m', 'pytest'] + sys.argv[1:] variable
37 print(f'Running pytest from {here}:\n\t' +
38 ' '.join(shlex.quote(s) for s in pytest),
40 subprocess.run(pytest, check=True, cwd=here)
/Zephyr-latest/samples/subsys/testsuite/pytest/shell/
DREADME.rst2 :name: Pytest shell application testing
4 Execute pytest tests against the Zephyr shell.
9 The sample project illustrates usage of pytest framework integrated with
13 and then calls pytest in subprocess which runs tests from
14 ``pytest/test_shell.py`` file. The first test verifies valid response for
17 is defined in ``pytest-twister-harness`` plugin. More information about plugin
32 $ ./scripts/twister -vv --platform native_sim -T samples/subsys/testsuite/pytest/shell
41 samples/subsys/testsuite/pytest/shell/pytest/test_shell.py::test_shell_print_help
72 samples/subsys/testsuite/pytest/shell/pytest/test_shell.py::test_shell_print_version
/Zephyr-latest/tests/subsys/logging/dictionary/
Dtestcase.yaml18 harness: pytest
21 - "pytest/test_logging_dictionary.py"
27 harness: pytest
30 - "pytest/test_logging_dictionary.py"
/Zephyr-latest/tests/misc/llext-edk/
Dtestcase.yaml2 misc.edk.pytest:
3 harness: pytest
5 - pytest
/Zephyr-latest/.github/workflows/
Dtwister_tests.yml55 - name: Run pytest for twisterlib
61 PYTHONPATH=./scripts/tests pytest ./scripts/tests/twister
62 - name: Run pytest for pytest-twister-harness
66 PYTHONPATH: ./scripts/pylib/pytest-twister-harness/src:${PYTHONPATH}
69 pytest ./scripts/pylib/pytest-twister-harness/tests
/Zephyr-latest/tests/subsys/debug/gdbstub/pytest/
Dconftest.py7 import pytest
16 @pytest.fixture()
21 @pytest.fixture()
26 @pytest.fixture()
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/device/
Dbinary_adapter_test.py13 import pytest
24 @pytest.fixture
29 @pytest.fixture(name='device')
40 @pytest.fixture(name='launched_device')
74 with pytest.raises(TwisterHarnessTimeoutException, match='Read from device timeout occurred'):
87 with pytest.raises(TwisterHarnessException, match=exception_msg):
96 with pytest.raises(TwisterHarnessException, match='Exception message'):
105 with pytest.raises(TwisterHarnessException, match='fake_file.txt'):
114 with pytest.raises(TwisterHarnessException, match='Raised other exception'):
119 caplog: pytest.LogCaptureFixture, launched_device: NativeSimulatorAdapter
[all …]
/Zephyr-latest/tests/kernel/timer/timer_behavior/pytest/
Dconftest.py7 import pytest
16 @pytest.fixture()
21 @pytest.fixture()
26 @pytest.fixture()
41 @pytest.fixture()

1234567