Skip to main content

Baygon

GitHub issues GitHub last commit Build and Deploy Python PyPI version PyPI - Downloads License codecov

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 --pretty to render rich panels for failing tests, including captured command telemetry.
  • Pass -T/--table to display an aggregated summary table once the run completes.
  • Provide a custom test definition with -c/--config. The legacy -t flag is still recognised but deprecated.
  • Run a subset of the tests with --only 2.1 (by id) or -k parsing (by name).
  • Limit the time of each test with --timeout 5, or with timeout: in the configuration.
  • Use --strict to exit with status 1 when a test fails.

Configuration highlights:

  • Match outputs with equals, contains, regex, number (with a tolerance or a range), length and lines, or compare them to a reference program with same-as.
  • Generate the standard input with another program: stdin: {executable: ./generate, args: ["{{ iter() }}"]}.
  • Check the source code (headers, forbidden functions, warnings, formatting) with grep, gcc or clang-format as the executable of a test.

Claude Code skill

Baygon comes with a skill that teaches Claude Code how to write and run Baygon tests. Install it as a plugin:

/plugin install baygon --marketplace heig-tin-info/baygon

or, with older Claude Code versions, claude plugin marketplace add heig-tin-info/baygon then claude plugin install baygon@baygon. It can also be copied from the Python package: baygon --install-skill user (all projects) or baygon --install-skill project (this project).

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

Metadata

Release files for baygon 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baygon 0.9.0
File Size Uploaded Provenance Actions
baygon-0.9.0.tar.gz 100.8 kB With provenance Details for baygon-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for baygon 0.9.0
File Interpreter ABI Platform Actions
baygon-0.9.0-py3-none-any.whl Python 3 none any Details for baygon-0.9.0-py3-none-any.whl

Total release size: 152.9 kB

Release files / baygon-0.9.0.tar.gz

Download URL baygon-0.9.0.tar.gz
Size 100.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46f17359dc13784942ebc76899f582fdc04573978d357fc24f81a828016396f4
BLAKE2b-256 checksum
How to use checksums
d4899c5ceb5a37eb81d59c0a5cbb27d57509a912b274c3942c3083580612abf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / baygon-0.9.0-py3-none-any.whl

Download URL baygon-0.9.0-py3-none-any.whl
Size 52.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3515bda1a1c192c460feb6744b350f704ad0a41a63f1a8d6de3566d8a99d187e
BLAKE2b-256 checksum
How to use checksums
c9271ff7498319015a20aa14471488e6255b04eb57bd2e72df312d8746488326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for baygon 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for baygon-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page