pytest-f3ts is a pytest plugin developed to extend the standard capabilities of pytest for hardware testing applications. It proves particularly valuable for Printed Circuit Board Assembly (PCBA) functional testing during manufacturing. The plugin integrates with existing pytest workflows while adding functionality specific to hardware test environments.
The tool also provides out-of-the-box support for FixturFab Test Runner, offering a factory-floor-friendly interface for test management and execution.
Installation#
The quickest setup method uses pip:
pip install pytest-f3tsFor the latest development version from the repository:
pip install git+https://gitlab.com/fixturfab/test-software/pytest-f3ts.gitBasic Test Plan Structure#
A minimal test plan requires a single Python file following pytest naming conventions (e.g., test_my_dut.py). This file must include a Test Interface fixture for controlling hardware and test case definitions.
Example Implementation#
import pytest
from .instruments import DMM
@pytest.fixture(scope="session")
def interface(request):
my_dmm = DMM()
def teardown():
my_dmm.close()
request.addfinalizer(teardown)
return my_dmm
def test_channel_1_voltage(interface):
meas = interface.get_voltage(1)
assert meas > 4.9
assert meas < 5.1This example demonstrates measuring and validating a 5V output from DMM channel 1.
Running Tests#
Execute your test plan with the standard pytest command:
pytest test_my_dut.pyWhen to Use pytest-f3ts#
pytest-f3ts fits teams that:
- Already use Python for test automation
- Need to test hardware at the functional level (not just electrical continuity)
- Want structured test reports with measurement data
- Plan to scale from development to production testing
If you're doing basic continuity testing or working with proprietary test platforms, simpler approaches may suffice. pytest-f3ts shines when you need the flexibility of Python combined with hardware-specific testing patterns.
Integration with FixturFab#
pytest-f3ts works with any test fixture, but integrates particularly well with FixturFab fixtures through our standard signal interface definitions. The plugin can automatically detect connected fixtures and configure test equipment based on fixture metadata.
When you configure a fixture in Studio, you can export a pytest-f3ts configuration file that maps signal names to physical test points, simplifying test development.
Documentation#
- Getting Started - Tutorial introduction to pytest for hardware testing
- Installation - Install pytest-f3ts and dependencies
- Configuration - Set up your hardware configuration
- Test Plans - Structure tests into organized plans
- Examples - Test patterns and recipes
- API Reference - Technical reference
- Messaging - Messaging architecture for Test Runner integration