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.
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'$ 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.
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())pip3 install baygonThe site is powered by MkDocs Material. From the repository root:
uv sync --group docs
uv run --group docs mkdocs serve --strictTo create a production build:
uv run --group docs mkdocs build --strictgit clone https://github.com/heig-tin-info/baygon.git
cd baygon
uv sync --group devInstall 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.0Then sync your uv environment:
uv sync --group devRun the automated checks:
uv run --group dev nox -s lint testsBaygon can even test itself against all supported Python versions:
uv run baygon .venv/bin/baygon