Skip to content
Testaroo
yaml242 B

Sample YAML

A YAML configuration file with nested mappings, sequences, inline lists, and comments, for testing YAML parsers.

Preview, first 17 linesyaml
# Sample YAML configuration
server:
  host: localhost
  port: 8080
  tls:
    enabled: true
    minVersion: "1.2"
features:
  - search
  - editor
  - preview
users:
  - name: Ada
    roles: [admin, editor]
  - name: Grace
    roles: [editor]

Specifications

Structure
mappings, sequences, inline lists, comments
Valid
true

Testing contract

Expected to pass
Scenario
Exercise Sample YAML in its yaml workflow. A YAML configuration file with nested mappings, sequences, inline lists, and comments, for testing YAML parsers.
Expected result
16 text lines, decoded as UTF-8; first nonempty line is '# Sample YAML configuration'. Declared feature checks: structure=mappings, sequences, inline lists, comments; valid=True.

What is a .yaml file?

YAML (YAML Ain't Markup Language) is a human-readable data-serialization format using indentation, key-value pairs, and lists, and is a superset of JSON. It supports comments, anchors, and multiple documents per file, favoring readability for configuration. Its indentation sensitivity makes it error-prone to hand-edit.

How to use this file

Use an example YAML file to test config parsers, indentation and anchor handling, multi-document streams, and safe-loading to avoid arbitrary object construction.

How to use this file for testing

“Sample YAML” is a deterministic Testaroo fixture for Data import. Realistic faker-generated datasets with documented schemas for testing import and ETL flows.

Documented properties for this file: mappings, sequences, inline lists, comments. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.

Data fixtures document their exact quirks (delimiters, encodings, null handling, schema, and row counts) in the spec table. Point your parser or importer at the file and assert it handles the documented edge cases; clean and deliberately-messy siblings make before/after diffs straightforward.

Code examples

import yaml  # pip install pyyaml

with open("sample.yaml") as f:
    data = yaml.safe_load(f)
print(data)

Generated by generation/data_structured.py. Free for any use, no attribution required, license.