Functional tests for teaching activities
Project description
Baygon
Kills Bugs Dead!
This package is a minimalist functional test suite for binaries. It relies on a description of tests usually in test.yml or test.json.
The documentation is available here.
Test file format
It can be either a .yml or a .json file.
version: 1
tests:
- name: Arguments check
tests:
- name: No errors if two arguments
args: [1, 2]
exit: 0
- name: Error if less than two arguments
args: [1]
exit: 1
- name: Stdout is the sum of arguments
args: [1, 2]
stdout: []
- name: Version on stderr
args: ['--version']
stderr:
- regex: '\b\d\.\d\.\d\b'
- contains: 'Version'
Usage
$ info-test -v ./a.out
Test 1: Arguments check
Test 1.1: No errors if two arguments................ PASSED
Test 1.2: Error if less than two arguments.......... PASSED
Test 2: Stdout is the sum of arguments.................. PASSED
Test 3: Version on stderr............................... PASSED
Ran 4 tests in 0.0s.
ok.
CLI highlights:
- Use
--prettyto render rich panels for failing tests, including captured command telemetry. - Pass
-T/--tableto display an aggregated summary table once the run completes. - Provide a custom test definition with
-c/--config. The legacy-tflag is still recognised but deprecated.
Programmatic usage
Baygon now exposes the same building blocks used by the CLI so you can embed the runner directly in your tooling:
from baygon.config import load_config
from baygon.runtime import BaygonRunner
suite = load_config("tests/smoke.yml")
runner = BaygonRunner(suite, base_dir=Path("tests"))
report = runner.run()
for case in report.cases:
print(f"{case.case.name}: {case.status}")
You can also extend Baygon by registering custom filters or matchers:
from baygon.filters import Filter, register_filter
@register_filter("strip-digits")
class FilterStripDigits(Filter):
def apply(self, value: str) -> str:
return "".join(c for c in value if not c.isdigit())
How to install?
pip3 install baygon
Build documentation
The site is powered by MkDocs Material. From the repository root:
uv sync --group docs
uv run --group docs mkdocs serve --strict
To create a production build:
uv run --group docs mkdocs build --strict
Contributing ?
git clone https://github.com/heig-tin-info/baygon.git
cd baygon
uv sync --group dev
Tests
Install pyenv then install all required version of Python:
pyenv install 3.9.9
pyenv install 3.10.4
pyenv install 3.11.0
pyenv install 3.12.0
pyenv install 3.13.0
pyenv global 3.9.9 3.10.4 3.11.0 3.12.0 3.13.0
Then sync your uv environment:
uv sync --group dev
Run the automated checks:
uv run --group dev nox -s lint tests
Baygon can even test itself against all supported Python versions:
uv run baygon .venv/bin/baygon
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 baygon-0.7.0.tar.gz.
File metadata
- Download URL: baygon-0.7.0.tar.gz
- Upload date:
- Size: 67.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bcb7e8a969713ac46eab6e5fcd477c1cd5a0acbe5d2ef963ed1faa3c8203e94
|
|
| MD5 |
73b90042266230eeaebff2f359dcea67
|
|
| BLAKE2b-256 |
7613265cd15c9d164705582f651baaa332873bda8708297d72bca841ef3c419d
|
Provenance
The following attestation bundles were made for baygon-0.7.0.tar.gz:
Publisher:
release.yml on heig-tin-info/baygon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baygon-0.7.0.tar.gz -
Subject digest:
7bcb7e8a969713ac46eab6e5fcd477c1cd5a0acbe5d2ef963ed1faa3c8203e94 - Sigstore transparency entry: 1009521121
- Sigstore integration time:
-
Permalink:
heig-tin-info/baygon@b3a7b3aeec1fa9c482c5a80efb3b0709e78628e0 -
Branch / Tag:
refs/tags/0.7.0 - Owner: https://github.com/heig-tin-info
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b3a7b3aeec1fa9c482c5a80efb3b0709e78628e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file baygon-0.7.0-py3-none-any.whl.
File metadata
- Download URL: baygon-0.7.0-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d592cbe6a4ec5289c2cdc1beed9ecc9380fd1e14eb36976fc9feaf7dc76f97e
|
|
| MD5 |
0627d88833f5dc2938296c4a31fc842a
|
|
| BLAKE2b-256 |
7df909f90278a2c01a1d496a82faf556a004373c048c387cf75b2506b223e491
|
Provenance
The following attestation bundles were made for baygon-0.7.0-py3-none-any.whl:
Publisher:
release.yml on heig-tin-info/baygon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baygon-0.7.0-py3-none-any.whl -
Subject digest:
4d592cbe6a4ec5289c2cdc1beed9ecc9380fd1e14eb36976fc9feaf7dc76f97e - Sigstore transparency entry: 1009521143
- Sigstore integration time:
-
Permalink:
heig-tin-info/baygon@b3a7b3aeec1fa9c482c5a80efb3b0709e78628e0 -
Branch / Tag:
refs/tags/0.7.0 - Owner: https://github.com/heig-tin-info
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b3a7b3aeec1fa9c482c5a80efb3b0709e78628e0 -
Trigger Event:
push
-
Statement type: