Pytest Tests in Twister
summary
A pytest plugin for Twister lets tests use pytest fixtures and plugins while Twister handles collection and reporting via JUnit XML, enabling device-type agnostic tests that run on hardware, QEMU or native posix. Implemented device adapters abstract serial/FIFO details, fixtures manage setup/teardown and scopes, and examples include interactive shell checks, an MCUboot downgrade prevention flow using mcumgr, and a full LwM2M end-to-end interoperability test that spins up a Leshan server in Docker and verifies live client-server exchanges.
AI-written summary · about
chapters (24)
- 0:00pytest in Twister intro
- 1:26Twister limitations
- 3:12Why pytest fits Twister
- 4:40pytest features for Twister
- 5:42pytest integration with Twister
- 7:48Running pytest in Twister
- 9:56Device adapters in plugin
- 11:42Fixtures as core building blocks
- 14:09Shell test example
- 16:50Test output demo
- 18:14MCU boot downgrade test
- 20:46LwM2M interoperability test
- 25:04Future plans
- 27:34Solution benefits
- 29:41Q&A
- 30:03Reliability testing
- 31:26Native Sim tests
- 33:36Stress testing
- 34:41Open source tools motivation
- 35:25Local server setup
- 36:48Hardware device tests
- 37:50Test scope config
- 39:36Twister and pytest sequencing
- 41:00Extending adapter factories
related talks
43mPytest Tests in Twister
35mTwister: A Test Utility for Contributors
23mTwister V2: New Framework for Testing Based on Pytest. Overview & Current Status
49mHarnessing the Twister: Zephyr Data-Driven Testing and Insights
49mHarnessing the Twister: Zephyr Data-Driven Testing and Insights
20mIntroduction To Twister and Adding Support for Hardware Runners
35mTesting: Choose Your Weapons
24mTesting Your Python Code
