Skip to main content
FixturFab

pytest-f3ts

A pytest plugin for hardware functional testing that provides fixtures, markers, and utilities for test automation of electronic devices.

stableHardware functional testing made pythonicPyPI

Features

pytest fixtures for hardware test setup and teardown
Markers for test categorization and conditional execution
Built-in support for serial communication and GPIO control
Integration with f3ts-hardware-utils for instrumentation
Structured test reporting with pass/fail/measurement data
Parallel test execution support for production environments

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-f3ts

For the latest development version from the repository:

pip install git+https://gitlab.com/fixturfab/test-software/pytest-f3ts.git

Basic 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.1

This 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.py

When 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#

Documentation Pages

Related Projects

View all open source projects

Use with FixturFab Fixtures

Our open-source testing stack integrates seamlessly with FixturFab fixtures. Configure your fixture in Studio and get a matching pytest-f3ts configuration.