/Zephyr-latest/scripts/tests/twister/pytest_integration/ |
D | test_harness_pytest.py | 5 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/ |
D | pytest.rst | 3 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/ |
D | README.rst | 2 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/ |
D | conftest.py | 10 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/ |
D | conftest.py | 11 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/ |
D | conftest.py | 5 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/ |
D | conftest.py | 5 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/ |
D | testcase.yaml | 16 - pytest 19 harness: pytest 22 - "pytest/test_upgrade.py" 26 - pytest 29 harness: pytest 32 - "pytest/test_downgrade_prevention.py"
|
D | README.rst | 5 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/ |
D | fixtures.py | 9 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/ |
D | conftest.py | 12 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
|
D | test_addon.py | 13 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/ |
D | test_can.py | 10 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 …]
|
D | conftest.py | 12 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/ |
D | test_data.yaml | 2 sample.twister.pytest: 5 harness: pytest 7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."] 10 - pytest
|
/Zephyr-latest/samples/subsys/testsuite/pytest/basic/ |
D | testcase.yaml | 2 sample.twister.pytest: 5 harness: pytest 7 pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."] 10 - pytest
|
/Zephyr-latest/tests/lib/devicetree/memory_region_flags/ |
D | testcase.yaml | 4 harness: pytest 8 - pytest 11 harness: pytest 15 - pytest
|
/Zephyr-latest/scripts/west_commands/ |
D | run_tests.py | 8 # 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/ |
D | README.rst | 2 :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/ |
D | testcase.yaml | 18 harness: pytest 21 - "pytest/test_logging_dictionary.py" 27 harness: pytest 30 - "pytest/test_logging_dictionary.py"
|
/Zephyr-latest/tests/misc/llext-edk/ |
D | testcase.yaml | 2 misc.edk.pytest: 3 harness: pytest 5 - pytest
|
/Zephyr-latest/.github/workflows/ |
D | twister_tests.yml | 55 - 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/ |
D | conftest.py | 7 import pytest 16 @pytest.fixture() 21 @pytest.fixture() 26 @pytest.fixture()
|
/Zephyr-latest/scripts/pylib/pytest-twister-harness/tests/device/ |
D | binary_adapter_test.py | 13 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/ |
D | conftest.py | 7 import pytest 16 @pytest.fixture() 21 @pytest.fixture() 26 @pytest.fixture() 41 @pytest.fixture()
|