Minimal cross-runtime test runner for ChuMicro libraries (workspace-internal).
Project description
chumicro-test-harness
A small cross-runtime test runner for ChuMicro libraries — internal to the mono-repo (not on PyPI), and meant to complement host-side pytest rather than replace it.
What it provides
| Module | What it exports |
|---|---|
chumicro_test_harness.runner |
run_module(module, name_filter=None) |
chumicro_test_harness.discovery |
discover_source_roots, setup_source_paths, run_one_file |
chumicro_test_harness.assertions |
raises (pytest-shaped context manager) |
chumicro_test_harness.skip |
skip(reason) |
Top-level re-exports: from chumicro_test_harness import raises, skip, run_module, run_one_file.
The harness powers cross-runtime unit tests. Files under libraries/*/tests/test_*.py (excluding *_pytest.py) execute under MicroPython unix-port and CircuitPython unix-port — and under CPython through normal pytest collection. Test files stay import pytest-free so the same sources run unchanged on every runtime.
How tests reach the harness
The pytest plugin chumicro-pytest-device owns discovery and orchestration. Two activation paths:
pytest libraries/<name>/tests --target unix-port --runtime micropython— plugin spawns one<micropython-binary> run_cross_runtime.py --worker <test_file>subprocess per file. The workerexec()s the file as a module, callsrun_module, and printsPASS/FAIL/SKIP/HEAP/SUMMARYlines back to the host.pytest libraries/<name>/functional_tests/— plugin routes through thechumicro-deploytransport instead, staging source onto a real board and running it there.
The chumicro workspace ships CLI wrappers that resolve the unix-port binary (workspace-prepared .tools/ build first, then PATH), auto-build it on first use, and delegate to the pytest invocation above. Pass --micropython-binary <path> / --circuitpython-binary <path> to override.
Device testing on real boards
Real-board execution does not go through this package — it goes through chumicro-pytest-device, the pytest plugin that stages source onto a board and runs functional_tests/ in the device runtime. IDE play buttons for functional_tests/ files use the same plugin.
The test harness shapes the on-device test environment (the chumicro_test_harness.skip() primitive, __chumicro_features__ markers, the assertions.raises helper) so the same test sources work both under unix-port harness runs and under on-device runs.
Skipping tests loudly
Use chumicro_test_harness.skip(reason) when a runtime feature isn't present (e.g. UDP on a runtime that lacks it). Bare if cond: return is a silent skip — it reads as PASS, hiding broken tests. The harness's skip() raises a sentinel exception the runner classifies as SKIP with the given reason, so missing features stay visible.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chumicro_test_harness_experimental-0.3.0.tar.gz.
File metadata
- Download URL: chumicro_test_harness_experimental-0.3.0.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b3287f790d8fbd6f4f6b21addd778215830849d53c4dc074ade7911cefd149
|
|
| MD5 |
f38054bdb1854b725017160f39cc30e3
|
|
| BLAKE2b-256 |
1604dc0c4dd4dd64d8a35d846b6416f39ce549f954cde996db01588a74438f7b
|
Provenance
The following attestation bundles were made for chumicro_test_harness_experimental-0.3.0.tar.gz:
Publisher:
release.yml on ChuMicro/ChuMicro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chumicro_test_harness_experimental-0.3.0.tar.gz -
Subject digest:
58b3287f790d8fbd6f4f6b21addd778215830849d53c4dc074ade7911cefd149 - Sigstore transparency entry: 2195185223
- Sigstore integration time:
-
Permalink:
ChuMicro/ChuMicro@808932736316bb449a89622b8d98f6c754cebd73 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ChuMicro
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@808932736316bb449a89622b8d98f6c754cebd73 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chumicro_test_harness_experimental-0.3.0-py3-none-any.whl.
File metadata
- Download URL: chumicro_test_harness_experimental-0.3.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b16c173ae6d7d79861d7d2f634f72ada7f4840dee10a6a556f1a34fb751786
|
|
| MD5 |
76b5e98cb99da68966d0d943c1224b8b
|
|
| BLAKE2b-256 |
b5cbce5a12099d6467298514b6a2d348e70e3e9af85e61f8af858a1b66f2dba0
|
Provenance
The following attestation bundles were made for chumicro_test_harness_experimental-0.3.0-py3-none-any.whl:
Publisher:
release.yml on ChuMicro/ChuMicro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chumicro_test_harness_experimental-0.3.0-py3-none-any.whl -
Subject digest:
f1b16c173ae6d7d79861d7d2f634f72ada7f4840dee10a6a556f1a34fb751786 - Sigstore transparency entry: 2195185228
- Sigstore integration time:
-
Permalink:
ChuMicro/ChuMicro@808932736316bb449a89622b8d98f6c754cebd73 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ChuMicro
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@808932736316bb449a89622b8d98f6c754cebd73 -
Trigger Event:
workflow_dispatch
-
Statement type: