Back to blog
November 24, 2026
14 min read
Instrument Automation

7 Python Hardware Test Frameworks in 2026 (pytest Alternatives)

pytest, OpenHTF, HardPy, TofuPilot, OpenTAP, Robot Framework, and TestFlow ranked for Python test stations on license, sequencing, operator UI, data, and drivers, each checked against the project's own repository.

7 Python Hardware Test Frameworks in 2026 (pytest Alternatives)

The main Python hardware test frameworks in 2026 are pytest with plugins, OpenHTF, HardPy, the TofuPilot framework, OpenTAP with its Python plugin, and Robot Framework, plus TestFlow as the AI agent option that builds the test for you. pytest stays the default for engineer-run validation. OpenHTF and the TofuPilot framework are the strongest pytest alternatives for production stations that need phases, measurements with limits, and operator prompts, and HardPy keeps pytest while adding an operator panel and a results database.

This guide is for engineers building a production or validation test station in Python, often after leaving LabVIEW or NI TestStand. Every license, release, and price below was checked on the project's own GitHub repository or website on November 24, 2026. For the wider Python stack underneath these frameworks, start with the Python instrument control guide.

What a Python test framework has to do on a bench

A unit-test runner and a station framework overlap by about half. pytest was built to test software, and the gaps show up the first time a technician, not an engineer, starts a run.

Score every option on six jobs:

  1. 1

    Sequencing. Ordered steps, setup and teardown that always run, retries, and a clear rule for what a failed step does to the rest of the run.

  2. 2

    Measurements with limits. A named value, a unit, a lower and upper bound, and a verdict, recorded as data rather than buried inside an assert.

  3. 3

    Operator UI. A screen where a technician scans a serial number, follows prompts, and reads PASS or FAIL.

  4. 4

    Data and reports. A per-run record in a stable schema, stored somewhere that can answer cross-unit questions in a year.

  5. 5

    Instrument drivers. What the framework gives you for the power supply, DMM, and scope. For most of this list the answer is nothing, and you bring PyVISA.

  6. 6

    License. MIT and Apache-2.0 are permissive. GPL-3.0 is copyleft and MPL-2.0 is file-level copyleft, which matters the day you sell a tester with the framework inside it.

If you only need jobs 1 and 2, plain pytest is enough. Jobs 3 and 4 are where the frameworks below earn their place, and the test sequencer comparison covers the same split from the TestStand side.

The 7 frameworks, ranked

Ranked for a team that writes Python and needs a station someone else can run. TestFlow sits second because it answers a different question from the rest: who writes the test in the first place.

1. pytest with plugins

What it is. The standard Python test runner, maintained by the pytest-dev community. Version 9.2.0 shipped on October 27, 2026, and the README lists Python 3.10 or newer as the requirement.

  • •License: MIT, per the pytest repository.
  • •Sequencing: test functions and modules, with fixtures for long-lived resources such as an open instrument session, and parametrization that turns one test into a matrix. Ordering and retries come from plugins: pytest-order runs tests in a set order and pytest-rerunfailures re-runs failed tests.
  • •Operator UI: none. pytest prints to a terminal.
  • •Data and reports: --junit-xml writes a JUnit XML file that Jenkins and other CI servers read, and the pytest-html plugin renders an HTML report.
  • •Instrument drivers: none. You bring PyVISA or a driver library.
  • •Ecosystem: the plugin list in pytest's own documentation counts 2,225 plugins.

The reporting command, as pytest's documentation gives it:

pytest --junit-xml=path

Who it fits. Engineer-run validation and characterization, hardware checks in CI, and any team that plans to add an operator layer later. HardPy and TofuPilot both sit on top of pytest, so starting here closes no doors. The catch: limits live in code, so changing a bound is a code change and a review.

2. TestFlow

What it is. An AI agent for electronics testing from TestFlow (testflowinc.com). You describe the test, naming the instruments, set points, and limits, and the agent builds a reviewable workflow and the Python for your instrument models, runs it on the bench, and writes the report from the measured results.

  • •License: commercial, with a free version to start. See pricing.
  • •Sequencing: named, reusable sequences with declared parameters, immutable published revisions, and version pinning. It also imports NI TestStand sequences and keeps the calls between them.
  • •Operator UI: an operator panel exported as an EXE, with barcode entry, group verdicts, live charts, and an end-of-test PDF.
  • •Data and reports: reports come from the run's own results, never typed in. Results export as PDF, Word, Excel, Markdown, JSON, or CSV.
  • •Instrument drivers: vendor-agnostic SCPI over VISA, with the catalog on the supported instruments page. The agent can add most missing SCPI instruments from the vendor's programming manual.
  • •Python: a workflow exports as a standalone Python package with one entry point that runs without TestFlow.

Honest limits. Bench runs need the Windows 10 or 11 desktop app; the web app builds and simulates. TestFlow covers only a few NI DAQ devices, and it is not a full test executive: there is no operator and user management and no database connectivity.

Who it fits. Teams where writing the test is the bottleneck, mixed-vendor benches, and LabVIEW or TestStand shops that want working automation next to what they already run. The line-by-line trade-off against a hand-written script is in TestFlow vs Python and PyVISA.

Best for
Teams that want automation without writing VIs or drivers
Cost
A paid Bench Pilot on your bench first, then a team licence
Tradeoff
Runs on your bench through the Windows desktop app
TestFlow: the agent's chat, the workflow it built, and the script for a load-transient test

3. OpenHTF

What it is. "The open-source hardware testing framework", hosted under Google's GitHub organization. Its README states plainly that it is not an official Google product. Version 1.6.3 shipped on October 8, 2026, and commits landed through November 2026, including a phase graph example and Mermaid flowchart visualization of test recipes.

  • •License: Apache-2.0, per google/openhtf.
  • •Sequencing: a test is a Python program that instantiates Test with phases, which are plain Python callables. The repository's examples cover phase groups, phase branches, checkpoints, repeats, and stop on first failure.
  • •Measurements: declared on the phase, with validators such as in_range (including marginal bands), units, and dimensions. Any measurement out of spec fails the run.
  • •Operator UI: a web GUI served by a station server, and a user_input plug that prompts the operator for a DUT ID at test start.
  • •Data and reports: output callbacks, including JSON through json_factory and a console summary, and you can write your own. Each run produces a test record with measurements, attachments, and an outcome.
  • •Instrument drivers: "plugs" wrap the DUT and test equipment. OpenHTF ships a small set, including user input, serial collection, ADB and fastboot devices over USB, and Cambrionix USB hubs. Bench instrument plugs are yours to write, usually around PyVISA.

A validated measurement, from OpenHTF's examples/measurements.py with the comments removed:

import openhtf as htf

@htf.measures(
    htf.Measurement('validated_measurement')
    .in_range(0, 10)
    .doc('This measurement is validated.')
    .with_units(htf.units.SECOND)
)
def measure_seconds(test):
  test.measurements.validated_measurement = 5

Who it fits. Code-first teams building manufacturing stations who want a measurement model stricter than assert, and who are comfortable writing their own plugs.

4. HardPy

What it is. A Python library "for creating a test bench for devices", built as a pytest plugin and published under the everypinio GitHub account, which also points users to its StandCloud analytics service. Version 0.25.2 shipped on June 9, 2026, and that was also the latest commit on its main branch when checked on November 24, 2026.

  • •License: GPL-3.0 on everypinio/hardpy; the PyPI package declares GPL-3.0-or-later.
  • •Sequencing: pytest underneath, with HardPy markers for module and case names, repeat attempts on failure, critical tests, and skips.
  • •Operator UI: a browser operator panel started with hardpy run on port 8000, with start and stop, dialog boxes with text, numeric, and checkbox widgets, operator messages, language switching, and test history. It opens on a tablet or phone while the tests run on the host PC.
  • •Data and reports: results go to CouchDB or to local JSON files, or to another database through an adapter you write, with optional upload to StandCloud.
  • •Instrument drivers: none. The README says so directly and points to PyMeasure, InstrumentKit, QCoDeS, and similar libraries.

A measurement with limits, trimmed from HardPy's examples/measurement/test_1.py:

import pytest

from hardpy import (
    ComparisonOperation as CompOp,
    NumericMeasurement,
    set_case_measurement,
)

@pytest.mark.case_name("Advanced numeric measurements")
def test_advanced_numeric_measurements():
    voltage_meas = NumericMeasurement(
        name="Voltage",
        value=1.2,
        unit="V",
        operation=CompOp.GELE,
        lower_limit=1.0,
        upper_limit=1.5,
    )
    set_case_measurement(voltage_meas)

Who it fits. pytest teams that need an operator panel and a results store this quarter without rewriting tests. If you ship stations to customers, have the GPL-3.0 terms reviewed before HardPy goes inside the product.

5. TofuPilot

What it is. A test data platform for hardware production from a team based in Lausanne, Switzerland, plus an open-source framework of its own. The platform adds unit traceability, alerts, and AI investigations across runs; the framework executes the procedures.

  • •License: the TofuPilot framework (v2.0.0, October 27, 2026) and the client SDKs for Python, C#, Rust, C++, and MATLAB are MIT. The hosted platform is commercial.
  • •Pricing: the Lab plan is free, with one paid seat, one station, 100 runs a month, and 1 GB of attachments; operators and viewers are free and unlimited. Pro is $50 a month per paid seat and per station, with 1,000 runs included and $0.01 per run after that. Enterprise is custom and is the only plan with self-hosting.
  • •Sequencing: in the framework, test logic is Python phases and the procedure is a YAML file, with dependencies, retries, cleanup, and parallel phases. The execution engine itself is a Rust crate.
  • •Operator UI: prompts and controls declared in YAML, and a local kiosk or browser interface on deployed stations. The branded operator kiosk is a Pro feature.
  • •Data and reports: runs upload to the platform, and completed runs queue locally when a station loses its connection. TofuPilot's docs list its own framework, OpenHTF, pytest, and Robot Framework as supported test runners, each with a starter template.
  • •Instrument drivers: plugs, which are reusable Python classes you write.

Who it fits. Production lines with several stations, where yield and traceability across thousands of units matter more than any single run. It pairs with OpenHTF or pytest as readily as with its own framework, which is why it ranks here as a data layer rather than a sequencer.

6. OpenTAP with the Python plugin

What it is. An open-source .NET test sequencer, copyright Keysight Technologies, and the engine underneath Keysight's commercial PathWave Test Automation. The core repository's latest tag is v9.35.3, dated November 6, 2026.

  • •License: the core is MPL-2.0, per opentap/opentap. The OpenTap.Python plugin is Apache-2.0, at v3.2.2.
  • •Sequencing: a full sequencer with test plans of steps, run from the tap command line, and a package manager for plugins.
  • •Python: the plugin lets you write test steps, instruments, DUTs, result listeners, and component settings in Python, through a fork of pythonnet.
  • •Operator UI: none in the open-source core. Keysight's Developer's System bundle adds a GUI with result viewing, under a community or commercial license.
  • •Data and reports: result listeners, including ones written in Python. The plugin's examples include a CSV result listener.
  • •Instrument drivers: a ScpiInstrument base class you subclass, plus plugin packages.
  • •Platforms: Windows and Ubuntu 24.04 installers, a terminal install on macOS and other Linux distributions, and Docker images.

The Python test step from the OpenTap.Python project template. Note the .NET types:

from opentap import *
from System import Int32
import OpenTap

@attribute(OpenTap.Display("Test Step Example", "A simple python test step", "OpenTap.Python.ProjectTemplate"))
class TestStepExample (TestStep):
    Number = property(Int32, 1000)
    def __init__(self):
        super(TestStepExample, self).__init__()

    def Run(self):
        self.log.Debug("Number: {0}", Int32(self.Number))

Who it fits. Teams on Keysight's stack, or with C# skills on staff, who want a real sequencer without per-station fees. The engine comparison against the incumbent is in OpenTAP vs NI TestStand, and the commercial wrapper is covered in Keysight PathWave alternatives.

7. Robot Framework

What it is. A generic keyword-driven automation framework for acceptance testing and RPA, implemented in Python and sponsored by the non-profit Robot Framework Foundation. Version 7.5.1 shipped on November 2, 2026.

  • •License: Apache-2.0, per robotframework/robotframework.
  • •Sequencing: test cases built from keywords in a tabular text syntax. Instrument actions are keywords you write in Python.
  • •Operator UI: none built in.
  • •Data and reports: the strongest default reporting here: an output file in XML or JSON, an HTML log, an HTML report, optional xUnit output, and rebot to merge and post-process results.
  • •Instrument drivers: none for bench instruments.

Who it fits. Teams where sequences must be readable and editable by people who will not write Python, and where one suite spans hardware checks and system-level acceptance tests.

Comparison table

pytest + pluginsTestFlowOpenHTFHardPyTofuPilotOpenTAP + PythonRobot Framework
LicenseMITCommercial, free versionApache-2.0GPL-3.0MIT framework, paid platformMPL-2.0 core, Apache-2.0 pluginApache-2.0
Test written asPython functionsA description; agent builds stepsPython phasespytest functionsPython phases + YAMLPython or C# stepsKeywords
Limits as dataIn code, or via a pluginYes, per stepYes, validatorsYes, measurement objectsYes, measurementsYes, in stepsIn test tables
Operator UINoneExported EXE panelWeb GUIBrowser panelKiosk or browserDeveloper's System GUINone
ResultsJUnit XML, HTML pluginPDF, Word, Excel, Markdown, JSON, CSVJSON, custom callbacksCouchDB, JSON, StandCloudHosted platformResult listenersXML or JSON, HTML log and report
Database built inNoNoNoCouchDBHostedVia listenerNo
Instrument driversBring PyVISASCPI catalog, few DAQPlugs you writeBring your ownPlugs you writeScpiInstrument base classKeywords you write
Per-station cost$0See pricing$0$0$50/month on Pro$0 for the core$0

No column wins every row. TestFlow is the only column where nobody writes the steps, and it pays for that with Windows-only bench runs, narrow DAQ support, and no database connectivity.

License and activity, verified November 24, 2026

ProjectLicenseLatest release or tagDateSource
pytestMIT9.2.0Oct 27, 2026github.com/pytest-dev/pytest
OpenHTFApache-2.01.6.3Oct 8, 2026github.com/google/openhtf
HardPyGPL-3.00.25.2Jun 9, 2026github.com/everypinio/hardpy
TofuPilot frameworkMIT2.0.0Oct 27, 2026github.com/tofupilot/framework
OpenTAPMPL-2.09.35.3Nov 6, 2026github.com/opentap/opentap
OpenTap.PythonApache-2.03.2.2Oct 28, 2026github.com/opentap/OpenTap.Python
Robot FrameworkApache-2.07.5.1Nov 2, 2026github.com/robotframework/robotframework

Activity matters more than stars for a station you will run for five years. Six of the seven repositories above tagged a release in the last 60 days. HardPy's main branch has been quiet for five months, which is worth a question in its community channels before you commit a production line to it.

How to choose: five questions

1. Who presses start?

An engineer means pytest, or Robot Framework if the sequence must read like a checklist. A technician means OpenHTF, HardPy, the TofuPilot framework, or a commercial executive. This one question removes half the list.

2. Do you already have a pytest suite?

If yes, do not rewrite it. Add HardPy for an operator panel and a local results store, or point it at TofuPilot through the pytest starter template for cross-station data. A rewrite into OpenHTF phases pays off only when you need its measurement model on every step.

3. Where must results live in 12 months?

One station and one engineer: a JSON or CSV file per run is fine. Many stations and yield questions: TofuPilot, or your own database fed by OpenHTF output callbacks, HardPy adapters, or OpenTAP result listeners. A signed report for a customer: you need report generation, not logging, and automated test report generation lists the fields a result row has to carry.

4. What does the tenth station cost?

Every open-source option here costs $0 per station. TofuPilot Pro bills each station: two engineers and three stations is five billable units, or $250 a month before run overage. TestStand charges a deployment license per station, which NI software licensing costs breaks down. If you sell testers to customers, add the license review for GPL-3.0 and MPL-2.0 to the same line item.

5. Is running the test the bottleneck, or writing it?

If running is slow, a better framework helps. If writing is slow, every framework here leaves the work exactly where it was, because each one assumes an engineer authors every phase. That is the case for TestFlow: describe the measurement, review the workflow, run it, and keep the exported Python next to the rest of your code.

Pairings that hold up

These tools combine more often than they compete. Four arrangements that follow directly from what each project documents:

  • •pytest + HardPy. Keep the tests, gain a browser panel and CouchDB or JSON storage. The cheapest path from a CI suite to a station a technician can run.
  • •OpenHTF + TofuPilot. OpenHTF runs the phases and TofuPilot holds the records across stations. TofuPilot's OpenHTF starter maps measurements and logs to its platform.
  • •pytest + TofuPilot. The pytest starter promotes asserts to measurements, so an existing suite gets traceability without new phase code.
  • •TestFlow + any of the above. TestFlow builds and runs the bench test on SCPI instruments, and the exported Python package lives in the same repository as the rest of the framework code.

The one combination to avoid is two sequencers fighting over the same instruments on one station. Pick one owner for the VISA sessions.

The instrument layer is the same in every option

Five of the six open-source options ship no drivers for a bench power supply, DMM, or oscilloscope. OpenTAP comes closest with its ScpiInstrument base class and plugin packages, TestFlow carries an instrument catalog, and everyone else expects you to bring a driver layer. In practice that layer is PyVISA over a VISA backend, speaking SCPI.

Write one class per instrument model, once, and wrap it as whatever the framework expects: a pytest fixture, an OpenHTF plug, a TofuPilot plug, or a Robot Framework keyword library. The hardware knowledge then survives a framework change. Start with the pyVISA tutorial, compare driver libraries in Python instrument control libraries compared, and keep the SCPI command cheat sheet open while you write it. For worked examples, see automating multimeter measurements in Python and automating a Keysight power supply in Python.

DAQ cards are the exception. None of these frameworks changes the fact that an NI DAQmx board needs NI's driver, covered in DAQ with Python. The transport question, USB, LAN, or GPIB, is in GPIB vs USB vs LAN instrument control.

Coming from LabVIEW or TestStand

Most teams reading this are moving off NI tooling, not starting fresh. The concepts map closely, with two exceptions.

TestStand conceptClosest Python equivalent
Sequence fileOpenHTF test, pytest module, TofuPilot procedure YAML
Step with limitsOpenHTF phase with a validated measurement, HardPy NumericMeasurement
Operator interfaceOpenHTF web GUI, HardPy panel, TofuPilot kiosk
Code module (VI, DLL)A Python driver class, wrapped as a plug or fixture
Database loggingCouchDB via HardPy, TofuPilot platform, or your own schema
User privilegesCheck each framework line by line

The two exceptions are run-time user privileges and shipped database schemas. TestStand provides both out of the box, and they are where Python frameworks differ most. If an auditor asks who ran the test and with what rights, settle that before migrating. The TestStand guide collects the full picture, TestStand pricing puts numbers on the licenses you would retire, and NI TestStand alternatives covers the commercial options too.

On the LabVIEW side, LabVIEW to Python migration is the step-by-step path, and LabVIEW vs Python is the honest trade-off for a team that has not decided yet. TestFlow works alongside both rather than requiring a rewrite; TestFlow vs TestStand shows exactly what it does and does not replace.

Where TestFlow fits

Python frameworks decide how a test runs and where its data lands. TestFlow works one step earlier, turning a description of the measurement into a reviewable workflow that runs on your bench.

  1. 1

    Connect your instruments. Pick the manufacturer and model, paste the VISA address (USB, LAN, GPIB, or serial), and the agent knows what is on your bench. No bench yet? Use a placeholder address, build the full automation, and swap in the real address when you are in the lab.

  2. 2

    Tell the agent what to test. For example, "run a VI sweep from 1 to 10 V in 1 V steps at 0.5 A load current," or "suggest the tests for a power-management device."

  3. 3

    The agent builds the complete workflow in seconds. Instrument-aware automation appears on the canvas, with the generated scripts visible in a code panel you can inspect and edit.

  4. 4

    Run it in your lab. Click Run in the TestFlow desktop app for Windows and the status panel streams results step by step, with measured values inline (VOUT = 3.301 V, asserted 3.2 to 3.4 V, PASS). One click exports a structured PDF report, or the raw results as CSV.

The TestFlow builder: a one-line test request on the left, the generated instrument workflow in the centre, and the live run with its streaming SCPI execution log on the right.
The TestFlow agent turning a one-line test request into a runnable workflow, then running it on the bench. Click to enlarge.
  • Vendor-neutral by design. One workflow drives Keysight, Tektronix, Rohde & Schwarz, Rigol, Keithley, Anritsu, and any other SCPI instrument over standard VISA.
  • Built in the browser, run on the bench. Workflows live in your workspace, so a sequence built in one lab runs the same way in another. Bench runs use the Windows desktop app.
  • Free version to start. Sign in at app.testflowinc.com and build your first workflow today; teams can book a demo to scope a Bench Pilot.
Instrument vendors TestFlow drives over VISA and SCPI: Keysight, Tektronix, Rohde & Schwarz, NI, Keithley, Agilent, Anritsu, Siglent, Chroma, Fluke, Yokogawa, Kikusui, TDK-Lambda, ESPEC, Watlow, Pickering, Copper Mountain, inTEST, Thermonics, and Microchip
Works with the instruments already on your bench. Full list on the supported instruments page.

The step-by-step walkthrough, VISA address formats, and Test Planner prompts are all in the TestFlow product guide.

Frequently asked questions

What are the best alternatives to pytest for hardware testing?

OpenHTF and the TofuPilot framework are the strongest code-first alternatives for production stations, because they add phases, measurements with limits, and operator prompts. OpenTAP with its Python plugin is a full sequencer, Robot Framework suits keyword-driven suites, and TestFlow builds the test from a description. HardPy is not a replacement: it runs on pytest and adds an operator panel and a results store.

Is OpenHTF still maintained?

Yes. OpenHTF 1.6.3 shipped on October 8, 2026, and commits landed in November 2026. It is Apache-2.0 licensed and hosted under Google's GitHub organization, although its README states that it is not an official Google product.

Can pytest be used for hardware testing?

Yes. Fixtures hold instrument sessions with setup and teardown, parametrization turns one test into a matrix, and pytest --junit-xml writes results a CI server reads. pytest ships no operator UI and no instrument drivers, so production stations usually add HardPy or TofuPilot on top and use PyVISA underneath.

Is TofuPilot free?

The TofuPilot framework and its client SDKs are MIT licensed. The hosted platform has a free Lab plan with one paid seat, one station, and 100 runs a month. Pro costs $50 a month per paid seat and per station, with 1,000 runs included and $0.01 per run after that. Enterprise is custom priced and is the only plan with self-hosting.

What is the best Python test sequencer for a production station?

For a code-first team, OpenHTF or the TofuPilot framework, since both model phases, measurements with limits, and operator prompts. For a team with an existing pytest suite, HardPy adds a panel without a rewrite. If the line needs run-time user privileges and shipped database schemas, NI TestStand provides both out of the box, so check each option here against those two needs before you move.

Where does TestFlow fit for a Python test team?

TestFlow is an AI agent that builds the bench test from a description, runs it on SCPI instruments through a Windows desktop app, and writes the report from measured results. It exports a standalone Python package. Its DAQ card coverage is limited to a few NI devices and has no operator and user management or database connectivity, so it sits next to a framework rather than replacing a production executive.

TestFlow

Automate every instrument in the lab,
Create test workflows in minutes

  1. 01Describe the testIn a sentence, the way you would tell a colleague.
  2. 02The agent builds itWorkflow and script for your instruments, any vendor.
  3. 03Run it, get the reportOn your bench, with the measured values.

Tags

alternatives to pytestpytest alternativespython test sequencerpytest for hardware testingopenhtfpython hardware test frameworkhardpytofupilot
Share this article:
Ali Kamaly

Article by

Ali Kamaly

Ali Kamaly is the Co-Founder and CEO of TestFlow, an AI-native platform for electronics test automation. He writes about test automation, lab validation, and the infrastructure behind modern hardware engineering.

Your next test, automated today

Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.