Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

yini-test-suite

Tests PyPI version

yini-test-suite is a command-line tool and shared collection of test cases for YINI parser implementations. Use it when building or testing a YINI parser.

It runs your parser through a small adapter program, compares the results with the expected JSON, and checks warnings and invalid inputs. Each case is reported as PASS or FAIL.

The same test cases can be used with parsers written in different languages.

YINI specification targets

Choose a suite version that targets the YINI specification your parser implements:

yini-test-suite version YINI specification target
0.4.0rc1 1.0.0-RC.7
0.3.0rc2 1.0.0-RC.6x — earlier RC.7 draft expectations
0.3.0rc1 1.0.0-RC.6

Suite and specification versions are independent. The links above identify fixed specification snapshots, including the earlier draft. The packaged case manifest records the current target. The runner prints that target in its summary.


📦 Install

Requires Python 3.10 or newer.

python -m pip install yini-test-suite

To include release candidates such as 0.4.0rc1, use:

python -m pip install --pre yini-test-suite

To select a version from the table, use yini-test-suite==<version> in the install command.

Check that the CLI is available:

yini-test-suite --help

The installed package includes the smoke and golden test cases. Use --cases-root only when you want to run a different collection of cases.


🚀 Basic Usage

Get an adapter from the parser implementation you want to test. To run the smaller smoke suite, replace path/to/adapter.py with your adapter's path:

yini-test-suite smoke --adapter python path/to/adapter.py --input "{input}" --mode "{mode}"

Run all bundled cases in both lenient and strict mode:

yini-test-suite all --all-modes --adapter python path/to/adapter.py --input "{input}" --mode "{mode}"

Important: --adapter must be the last yini-test-suite option. Everything after --adapter is treated as part of the adapter command.

The runner replaces:

  • {input} with the current .yini case path.
  • {mode} with lenient or strict.

Use --show-progress if you also want a RUN line before each case:

yini-test-suite all --all-modes --show-progress --adapter python path/to/adapter.py --input "{input}" --mode "{mode}"

The double quotes around the placeholders make these commands work in Bash, PowerShell, and Windows Command Prompt.

Use --fail-fast to stop after the first failing case. Put it before --adapter, like the other runner options.


🧪 Suites and modes

Suites:

  • smoke runs a small set of cases for a quick check.
  • golden runs a larger set of cases with fixed expected results.
  • all runs both suites and is the default when no suite is specified.

Modes:

  • Lenient mode is the default.
  • --strict runs strict-mode cases.
  • --all-modes runs both lenient and strict mode and prints one combined summary.

🔌 Adapter Contract

An adapter is a small command-line program maintained with a parser. It accepts an input file and parser mode, writes one JSON result to stdout on success, and writes warnings or errors to stderr. It must return a non-zero exit code when parsing fails.

The expected shape is:

adapter --input <path-to-yini-file> --mode <lenient|strict>

For details, see docs/adapter-contract.md.


Examples with official parsers

Parser-specific adapter scripts are maintained in their parser repositories, not in this runner package.

This repository provides example commands and Taskfile tasks for yini-parser-typescript, yini-parser-python, and yini-parser-go. Those examples require the corresponding sibling repository and its adapter; they are not included in an installed yini-test-suite package.

For these examples, place the parser repositories alongside this repository:

YINI-lang-WORK/
  yini-test-suite/
  yini-parser-typescript/
  yini-parser-python/
  yini-parser-go/

Follow each parser repository's setup instructions first. Run the commands below from the yini-test-suite repository root. The direct TypeScript command assumes its adapter has already been built.

Example TypeScript adapter command:

yini-test-suite all --all-modes --adapter node ../yini-parser-typescript/dist-tools/tools/yini-test-adapter.js --input "{input}" --mode "{mode}"

Example Python adapter command:

yini-test-suite all --all-modes --adapter python ../yini-parser-python/tools/yini_parser_adapter.py --input "{input}" --mode "{mode}"

When working from the source repository, the matching Taskfile commands are:

task run-all-typescript
task run-all-python
task run-all-go

The TypeScript and Go tasks build their adapters before running cases. The Go tasks require Go 1.22 or newer and write the adapter to this repository's build/ directory.

If these runs expose parser or adapter problems, fix those issues in the corresponding parser repository unless the shared case corpus or runner contract is wrong.


Output

A run starts with the runner name and version:

yini-test-suite 0.4.0rc1

Each case is reported as PASS or FAIL, followed by a final summary. Example summary header (the adapter and parser version depend on what you run):

YINI Test Suite Summary
yini-test-suite: 0.4.0rc1
Adapter: yini-parser-typescript
Parser version: 1.7.0
YINI spec: 1.0.0-RC.7
Test suite: "all"

For valid cases, the runner compares the adapter JSON output with the matching expected .json file. Warning cases also check expected warning diagnostics. Invalid cases are expected to fail.

The command exits with code 0 when all selected cases pass. It returns a non-zero exit code if any case fails or the run cannot complete, so it can be used in CI.


Scope

This package provides the runner and test cases. Parsers and their adapters live in separate repositories. The yini_test Python modules are internal; they are not intended as a stable public library API.


🛠️ Development

For source checkout setup, Taskfile commands, local adapter runs, build checks, and troubleshooting, see docs/Development-Setup.md.

Useful maintainer references:

After following the development setup, run task check before submitting a change. Those checks test the runner itself. Use the adapter tasks above to test parser behavior against the shared cases.


License

Licensed under the Apache License 2.0.


💬 Help, feedback, and issues

For bugs, feedback, or other issues with yini-test-suite, open an issue.

For general YINI information, see:


About YINI

YINI is a human-readable, INI-inspired, indentation-insensitive configuration format with clear nested sections, explicit structure, and predictable parsing.

yini-lang.org | YINI-lang on GitHub

Metadata

Release files for yini-test-suite 0.4.0rc1

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

Source distribution (sdist)

Source distribution for yini-test-suite 0.4.0rc1
File Size Uploaded Provenance Actions
yini_test_suite-0.4.0rc1.tar.gz 115.0 kB Without provenance Details for yini_test_suite-0.4.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yini-test-suite 0.4.0rc1
File Interpreter ABI Platform Actions
yini_test_suite-0.4.0rc1-py3-none-any.whl Python 3 none any Details for yini_test_suite-0.4.0rc1-py3-none-any.whl

Total release size: 461.7 kB

Release files / yini_test_suite-0.4.0rc1.tar.gz

Download URL yini_test_suite-0.4.0rc1.tar.gz
Size 115.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c72ab66a5526331d66cf59436093360d5f49140b0d01d2465f4d6c09dcdbecdb
BLAKE2b-256 checksum
How to use checksums
d4208d831974bd624e0402fb4e6536c3157e4c9085fb81a343036067645004f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / yini_test_suite-0.4.0rc1-py3-none-any.whl

Download URL yini_test_suite-0.4.0rc1-py3-none-any.whl
Size 346.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9a8133c7b9c973887a2469c7298d95d443aa32ae13d860246766d3810e7cb4e
BLAKE2b-256 checksum
How to use checksums
ebb793c78ad2bdf671ba88a2791872b67606c9d94c5f8b76b71e331db43e4edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for yini-test-suite 0.4.0rc1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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