libyaml Validation
Port build from safelibs/port-libyaml at commit 8274cb28c86e (release build-8274cb28c86e)
Tests
YAML anchor alias handling Original / libyaml / anchor-alias-handling Passed
libyaml compile link smoke Original / libyaml / compile-link-smoke Passed
Invalid YAML rejection Original / libyaml / invalid-yaml-rejection Passed
YAML loader dumper cases Original / libyaml / loader-dumper-cases Passed
YAML parser emitter round trip Original / libyaml / parser-emitter-roundtrip Passed
PyYAML yaml.add_constructor module-level API binds a tag on a Loader subclass Original / libyaml / usage-python3-yaml-add-constructor-module-batch18 Passed
Uses the module-level yaml.add_constructor function (rather than calling Loader.add_constructor as a classmethod) with an explicit Loader= argument to register a "!point" constructor that builds a (x, y) tuple from a "x,y" scalar. Verifies the registration is scoped to the supplied loader subclass and that the parent SafeLoader still rejects the unknown !point tag.
PyYAML add_constructor str subclass Original / libyaml / usage-python3-yaml-add-constructor-str-subclass-batch12 Passed
Registers a custom !slug constructor on a SafeLoader subclass and confirms loaded values are instances of the str subclass.
PyYAML SafeLoader add_implicit_resolver for ^0x[0-9a-f]+$ Original / libyaml / usage-python3-yaml-add-implicit-resolver-hex-batch15 Passed
Subclasses yaml.SafeLoader and registers an add_implicit_resolver bound to a fresh "!hex" tag with the regex ^0x[0-9a-f]+$ together with a constructor that parses the hex digits to an int. Verifies plain scalars matching the pattern are wrapped to the integer value while non-matching scalars (decimal ints, plain strings) keep their default tag resolution.
PyYAML yaml.add_multi_constructor dispatches all tags sharing a prefix Original / libyaml / usage-python3-yaml-add-multi-constructor-batch18 Passed
Registers a single multi-constructor for the "!ext:" tag prefix on a SafeLoader subclass so that any tagged scalar whose tag starts with !ext: is routed through one handler that receives the tag suffix. Verifies that two distinct suffixes (!ext:int and !ext:rev) are both dispatched to the same constructor and produce different result objects derived from the suffix.
PyYAML SafeDumper.add_multi_representer covers a class hierarchy Original / libyaml / usage-python3-yaml-add-multi-representer-class-hierarchy-batch16 Passed
Subclasses yaml.SafeDumper, registers add_multi_representer on a base class, and dumps instances of two subclasses verifying both subclass instances are serialized through the inherited representer to the expected scalar form.
PyYAML yaml.add_path_resolver retags a scalar at a fixed mapping path Original / libyaml / usage-python3-yaml-add-path-resolver-mapping-batch18 Passed
Calls yaml.add_path_resolver to register a "!secret" tag that fires whenever a scalar is loaded as the value of the "password" key at the document root, and binds a constructor for !secret that wraps the raw text. Verifies that the path-located scalar receives the custom tag (its constructed value is wrapped) while a sibling key at the same level retains the default string tag.
PyYAML SafeLoader add_implicit_resolver custom scalar tag Original / libyaml / usage-python3-yaml-add-path-resolver-scalar-batch14 Passed
Registers a regex-based implicit resolver on a SafeLoader subclass with a paired custom constructor, then verifies scalars whose plain form matches the pattern are wrapped with a custom Python type while non-matching scalars retain their default integer or string tags. The "path resolver" abstraction in PyYAML is exposed at scalar-resolution time via the same first_in tables, so this exercises the same machinery as add_path_resolver against a single scalar pattern.
PyYAML add_representer for an int subclass Original / libyaml / usage-python3-yaml-add-representer-int-subclass-batch13 Passed
Registers a yaml.add_representer for an int subclass that emits the value as a plain integer scalar, verifying the dumper picks the custom representer instead of failing on the unknown subclass.
PyYAML alias identity Original / libyaml / usage-python3-yaml-alias-identity Passed
PyYAML anchors Original / libyaml / usage-python3-yaml-anchors Passed
PyYAML BaseLoader boolean string Original / libyaml / usage-python3-yaml-base-loader-bool-string Passed
PyYAML base loader integer string Original / libyaml / usage-python3-yaml-base-loader-int-string Passed
PyYAML base loader null string Original / libyaml / usage-python3-yaml-base-loader-null-string Passed
PyYAML binary scalar decoding Original / libyaml / usage-python3-yaml-binary-scalar Passed
PyYAML binary tag base64 round-trip via CSafe backend Original / libyaml / usage-python3-yaml-binary-tag-roundtrip Passed
Round-trips raw bytes through CSafeDumper and CSafeLoader using the !!binary tag and confirms base64 encoding and exact byte recovery.
PyYAML block chomp strip Original / libyaml / usage-python3-yaml-block-chomp-strip-batch11 Passed
PyYAML block scalar Original / libyaml / usage-python3-yaml-block-scalar Passed
PyYAML safe_load consumes a UTF-8 BOM at the start of the stream Original / libyaml / usage-python3-yaml-bom-utf8-load-batch17 Passed
Builds a YAML byte string prefixed with the UTF-8 BOM (EF BB BF) and verifies that yaml.safe_load on the bytes object consumes the BOM and returns the expected mapping with the first key intact and not prefixed by a stray BOM character.
PyYAML CSafeDumper canonical output format Original / libyaml / usage-python3-yaml-canonical-dump-format Passed
Emits a mapping with canonical=True via CSafeDumper and verifies fully-tagged canonical YAML output that round-trips through CSafeLoader.
PyYAML CBaseLoader scalar parsing Original / libyaml / usage-python3-yaml-cbase-loader Passed
PyYAML yaml.CDumper (libyaml-backed full dumper) round-trips a mixed structure Original / libyaml / usage-python3-yaml-cdumper-roundtrip-batch18 Passed
Uses yaml.CDumper, the libyaml-backed C variant of the full dumper, to serialize a mixed Python structure (dict with int, float, list, and bool values), then parses the output back with yaml.CSafeLoader and verifies value-level equality and type preservation across the round-trip.
PyYAML yaml.CLoader (libyaml-backed full loader) parses a nested mapping Original / libyaml / usage-python3-yaml-cloader-mapping-batch18 Passed
Exercises yaml.CLoader, the libyaml-backed C variant of the full loader, by parsing a nested mapping with a list value and a quoted string. Verifies that yaml.CLoader is available (which on Ubuntu 24.04 requires python3-yaml to have been built against libyaml) and that the parsed Python objects match the expected structure and types.
PyYAML compose_all documents Original / libyaml / usage-python3-yaml-compose-all-documents Passed
Composes multiple YAML documents with compose_all and verifies both document roots are available in order.
PyYAML compose preserves anchor identity in resulting Node graph Original / libyaml / usage-python3-yaml-compose-anchor-alias-graph-batch15 Passed
Composes a document that uses an anchor on a mapping and an alias referencing it, then walks the produced yaml.nodes graph and verifies the alias resolves to the same Node object as the anchored mapping (object identity, not just equality).
PyYAML compose document tag Original / libyaml / usage-python3-yaml-compose-document-tag-batch11 Passed
PyYAML compose returns None for empty document Original / libyaml / usage-python3-yaml-compose-empty-document-batch14 Passed
Calls yaml.compose on an empty stream and a stream containing only directives and verifies it returns None for the empty case while compose_all yields the same number of nodes as documents.
PyYAML compose mapping node Original / libyaml / usage-python3-yaml-compose-mapping-node Passed
PyYAML compose with multiline literal scalar value Original / libyaml / usage-python3-yaml-compose-multiline-scalar-batch13 Passed
Composes a mapping whose value is a literal block scalar and verifies the resulting ScalarNode preserves the multiline content with a trailing newline.
PyYAML compose node tag and children Original / libyaml / usage-python3-yaml-compose-node-tag-and-children-batch12 Passed
Composes YAML through PyYAML and verifies the root MappingNode tag plus child ScalarNode tags and values.
PyYAML compose node Original / libyaml / usage-python3-yaml-compose-node Passed
PyYAML compose scalar tag Original / libyaml / usage-python3-yaml-compose-scalar-tag Passed
PyYAML compose sequence length Original / libyaml / usage-python3-yaml-compose-sequence-length Passed
Composes a YAML sequence node with PyYAML and verifies the resulting node contains the expected number of items.
PyYAML compose sequence Original / libyaml / usage-python3-yaml-compose-sequence Passed
PyYAML CSafeLoader and CSafeDumper backend available Original / libyaml / usage-python3-yaml-csafe-backend-available Passed
Confirms PyYAML exposes the libyaml-backed CSafeLoader and CSafeDumper classes and that safe_load is wired to the C backend.
PyYAML CSafeDumper binary Original / libyaml / usage-python3-yaml-csafe-binary-dump Passed
PyYAML CSafeDumper block vs flow output verification Original / libyaml / usage-python3-yaml-csafe-block-vs-flow-output Passed
Emits the same mapping with default_flow_style False and True via CSafeDumper and verifies block style omits braces while flow style uses braces.
PyYAML CSafeDumper explicit end Original / libyaml / usage-python3-yaml-csafe-dump-explicit-end Passed
Dumps multiple YAML documents with explicit end markers and verifies the terminator appears in the emitted text.
PyYAML CSafeDumper explicit start and end markers Original / libyaml / usage-python3-yaml-csafe-dump-explicit-start-end Passed
Dumps a mapping with explicit_start and explicit_end markers using CSafeDumper and verifies both directives appear and round-trip cleanly.
PyYAML CSafeDumper flow style Original / libyaml / usage-python3-yaml-csafe-dump-flow Passed
PyYAML csafe dumper Original / libyaml / usage-python3-yaml-csafe-dumper Passed
PyYAML CSafeLoader flow set Original / libyaml / usage-python3-yaml-csafe-flow-set-batch11 Passed
PyYAML CSafeDumper indent option controls block indentation Original / libyaml / usage-python3-yaml-csafe-indent-option Passed
Dumps a nested mapping with CSafeDumper using indent=6 and verifies six-space indentation is applied and the result round-trips.
PyYAML CSafeLoader load_all three documents jq verified Original / libyaml / usage-python3-yaml-csafe-load-all-three-docs-jq Passed
Streams three YAML documents through CSafeLoader.load_all, dumps them as JSON, and validates each document with jq.
PyYAML CSafeLoader anchor alias Original / libyaml / usage-python3-yaml-csafe-load-anchor-alias Passed
Loads an anchored scalar and its alias through the C-backed PyYAML loader and verifies both keys resolve to the same value.
PyYAML CSafeLoader binary bytes Original / libyaml / usage-python3-yaml-csafe-load-binary-bytes Passed
PyYAML CSafeLoader bool map Original / libyaml / usage-python3-yaml-csafe-load-bool-map Passed
PyYAML CSafeLoader mapping Original / libyaml / usage-python3-yaml-csafe-load-mapping Passed
PyYAML csafe loader Original / libyaml / usage-python3-yaml-csafe-loader Passed
PyYAML CSafeLoader multiple docs Original / libyaml / usage-python3-yaml-csafe-multidoc Passed
PyYAML CSafe round trip dict Original / libyaml / usage-python3-yaml-csafe-roundtrip-dict Passed
PyYAML CSafeLoader sequence Original / libyaml / usage-python3-yaml-csafe-sequence Passed
PyYAML custom dice resolver Original / libyaml / usage-python3-yaml-custom-dice-resolver-batch11 Passed
PyYAML custom representer serializes a dataclass via asdict Original / libyaml / usage-python3-yaml-dataclass-representer-batch17 Passed
Registers a SafeDumper representer that converts a Python dataclass instance into its asdict mapping, dumps a list of two instances, and verifies both are emitted as plain YAML mappings that round-trip back through yaml.safe_load.
PyYAML safe_dump and safe_load round-trip datetime.datetime via the timestamp tag Original / libyaml / usage-python3-yaml-datetime-safedump-roundtrip-batch18 Passed
Calls yaml.safe_dump on a dict whose values are a datetime.datetime and a datetime.date, verifies the emitted text uses the canonical ISO 8601 form (no quoting), and reloads the document via yaml.safe_load to confirm the values come back as the original datetime / date Python objects with full second-precision equality.
PyYAML documents Original / libyaml / usage-python3-yaml-documents Passed
PyYAML dump emits anchor and alias for shared object Original / libyaml / usage-python3-yaml-dump-aliases-cycle-batch13 Passed
Dumps a structure that reuses the same list object twice and verifies yaml.dump emits an anchor (&) on the first occurrence and an alias (*) on the second.
PyYAML dump_all emits --- separators between documents Original / libyaml / usage-python3-yaml-dump-all-document-separators-batch15 Passed
Feeds an iterable of three distinct documents to yaml.dump_all and verifies the output contains exactly two "---" document-start markers separating the three documents (the first document does not require a leading separator). Then re-loads the stream with yaml.safe_load_all and confirms the round-trip yields the original three documents.
PyYAML dump all explicit end Original / libyaml / usage-python3-yaml-dump-all-explicit-end Passed
PyYAML dump_all explicit start Original / libyaml / usage-python3-yaml-dump-all-explicit-start Passed
Dumps multiple YAML documents with explicit document starts and verifies both start markers are emitted.
PyYAML dump_all over multi-document round-trip Original / libyaml / usage-python3-yaml-dump-all-multidoc-roundtrip-batch13 Passed
Dumps a list of documents with yaml.dump_all and verifies safe_load_all reproduces all documents in order.
PyYAML dump emits each scalar style on demand Original / libyaml / usage-python3-yaml-dump-all-scalar-styles-batch15 Passed
Drives yaml.dump with default_style set to each of the documented scalar styles ('"', "'", "", "|", ">") on the same string payload and verifies each style is reflected in the emitted output (double quotes, single quotes, plain, literal block, and folded block respectively).
PyYAML dump allow_unicode=False escapes non-ASCII Original / libyaml / usage-python3-yaml-dump-allow-unicode-false-escape-batch14 Passed
Dumps non-ASCII scalars with yaml.dump allow_unicode=False and verifies PyYAML emits backslash-u escape sequences instead of the literal characters, contrasting with allow_unicode=True.
PyYAML dump allow unicode UTF-8 bytes Original / libyaml / usage-python3-yaml-dump-allow-unicode-utf8-batch12 Passed
Dumps non-ASCII scalars with yaml.dump allow_unicode=True and verifies the literal characters and their UTF-8 encoded bytes appear in the output.
PyYAML yaml.dump emits an anchor and alias for a shared list reference Original / libyaml / usage-python3-yaml-dump-anchor-shared-ref-batch17 Passed
Builds a Python mapping where two keys point at the exact same list object, dumps it with yaml.dump, and verifies a single anchor (&id001) and matching alias (*id001) are emitted so that reloading reproduces the shared reference under SafeLoader.
PyYAML dump roundtrip of arbitrary-precision integer 10**20 Original / libyaml / usage-python3-yaml-dump-bigint-1e20-roundtrip-batch15 Passed
Dumps a Python arbitrary-precision integer (10**20, well beyond int64) with yaml.dump, asserts the emitted scalar is the exact decimal digit string, and verifies yaml.safe_load reads it back as a Python int with the same numeric value.
PyYAML dump forces block style on a list Original / libyaml / usage-python3-yaml-dump-block-style-list-batch14 Passed
Dumps a list two ways via yaml.dump — once with default_flow_style=False forcing block style, once with True forcing flow style — and verifies the block form uses leading hyphens on separate lines while the flow form uses bracketed inline syntax, with both round-tripping to the same Python list.
PyYAML dump bytes via default Dumper emits !!binary Original / libyaml / usage-python3-yaml-dump-bytes-binary-tag-default-batch12 Passed
Dumps a bytes payload through the default yaml.Dumper and verifies the emitted scalar uses the !!binary tag with base64-encoded content that round-trips via full_load.
PyYAML dump default_flow_style=None auto-detects nested vs leaf Original / libyaml / usage-python3-yaml-dump-default-flow-style-none-autodetect-batch15 Passed
Calls yaml.dump with default_flow_style=None on a structure that mixes a leaf list of scalars with a nested mapping containing further structure. Verifies the auto-detect heuristic emits the leaf list inline ([..]) while the outer mapping uses block style (one key per line), in contrast to default_flow_style=False (all block) and =True (all flow).
PyYAML dump default_style single quote Original / libyaml / usage-python3-yaml-dump-default-style-single-quote-batch12 Passed
Dumps mapping values with yaml.dump default_style="'" and verifies every scalar value is wrapped in single quotes.
PyYAML yaml.dump preserves empty list and empty dict in flow style Original / libyaml / usage-python3-yaml-dump-empty-flow-collections-batch16 Passed
Dumps a mapping containing an empty list and an empty dict with default_flow_style=False and verifies the empty collections are emitted in flow form ('[]' and '{}') and round-trip back to identical Python objects.
PyYAML serialize emits explicit non-default sequence tag Original / libyaml / usage-python3-yaml-dump-explicit-seq-tag-batch14 Passed
Builds a yaml.SequenceNode whose tag is a non-default custom tag (!myseq), serializes it through yaml.serialize, and verifies the !myseq tag literal appears verbatim in the rendered YAML alongside the two scalar payloads. The default !!seq tag is elided by the emitter when the resolver would already infer it; this exercises the explicit-tag emission path that round-trips the tag literal into the output stream.
PyYAML dump float inf and nan round-trip Original / libyaml / usage-python3-yaml-dump-float-inf-nan-roundtrip-batch12 Passed
Dumps floating-point infinity and NaN with yaml.dump and verifies the .inf and .nan literal scalars are emitted and round-trip correctly.
PyYAML yaml.dump indent=2 vs 4 vs 8 produce distinct outputs Original / libyaml / usage-python3-yaml-dump-indent-2-4-8-distinct-batch16 Passed
Dumps the same nested mapping three times with indent=2, 4, and 8 and verifies the three serializations differ from each other and use the expected step widths for the inner key.
PyYAML dump with explicit line_break='\n' Original / libyaml / usage-python3-yaml-dump-line-break-control-batch13 Passed
Dumps a mapping with yaml.dump and line_break='\n' and verifies output uses LF line endings exclusively (no CR bytes present).
PyYAML yaml.dump with line_break='\r\n' emits DOS line endings Original / libyaml / usage-python3-yaml-dump-line-break-crlf-batch16 Passed
Dumps a multi-key mapping with line_break set to '\r\n' and verifies every line break in the output uses CRLF and the bytes contain CR characters before each LF.
PyYAML dump nested anchors at multiple levels Original / libyaml / usage-python3-yaml-dump-nested-anchors-multilevel-batch14 Passed
Dumps a structure that shares both an inner mapping and an outer list across multiple keys, and verifies yaml.dump emits two distinct anchors with corresponding aliases.
PyYAML dump nested list of dicts Original / libyaml / usage-python3-yaml-dump-nested-list-of-dicts-batch12 Passed
Dumps a list of dicts with yaml.dump and verifies block-style indentation, dash markers, and full round-trip equality.
PyYAML yaml.dump nested mapping of lists of dicts uses canonical block layout Original / libyaml / usage-python3-yaml-dump-nested-map-of-lists-of-dicts-batch16 Passed
Dumps a mapping whose values are lists of dictionaries with default block style and verifies the exact indentation pattern (top-level key, sequence dash, and nested mapping keys) and round-trips through safe_load.
PyYAML dump preserves OrderedDict insertion order Original / libyaml / usage-python3-yaml-dump-ordered-dict-key-order-batch14 Passed
Registers a representer for collections.OrderedDict on yaml.SafeDumper and verifies yaml.safe_dump emits keys in insertion order rather than alphabetically when sort_keys=False.
PyYAML dump sort keys false Original / libyaml / usage-python3-yaml-dump-sort-keys-false-batch11 Passed
PyYAML dump writes through a passed file-like stream Original / libyaml / usage-python3-yaml-dump-stream-file-like-batch15 Passed
Calls yaml.dump with an explicit stream= argument bound to an opened text-mode file handle, verifies that yaml.dump returns None (no in-memory string), and confirms the same content is materialized on disk via the stream. Then repeats the call with an io.StringIO buffer to confirm the same protocol works for in-memory streams.
PyYAML yaml.dump emits a %TAG directive when tags mapping is supplied Original / libyaml / usage-python3-yaml-dump-tag-directive-batch17 Passed
Calls yaml.dump with explicit_start=True and a tags={'!ex!': 'tag:example.com,2026:'} parameter and verifies the output contains a %TAG directive line mapping the !ex! handle to the provided URI prefix and that the document is still parseable by SafeLoader.
PyYAML dump with %YAML 1.2 version directive Original / libyaml / usage-python3-yaml-dump-version-directive-batch13 Passed
Dumps a mapping with yaml.dump and version=(1, 2) and verifies the %YAML 1.2 directive is emitted in the output stream.
PyYAML yaml.dump with width=10 force-wraps long strings Original / libyaml / usage-python3-yaml-dump-width-10-force-wrap-batch16 Passed
Dumps a mapping containing a long whitespace-bearing string with yaml.dump(width=10) and verifies the emitter wraps the value across multiple lines while still round-tripping back to the original string under safe_load.
PyYAML dump width wraps flow mapping Original / libyaml / usage-python3-yaml-dump-width-flow-mapping-wrap-batch12 Passed
Dumps a flow-style mapping with yaml.dump width=20 and verifies the output wraps onto multiple lines while still round-tripping.
PyYAML dump Original / libyaml / usage-python3-yaml-dump Passed
PyYAML yaml.emit produces YAML from a hand-built event sequence Original / libyaml / usage-python3-yaml-emit-events-stream-batch17 Passed
Builds a yaml.events sequence (StreamStart, DocumentStart, MappingStart, two ScalarEvent pairs, MappingEnd, DocumentEnd, StreamEnd) and feeds it to yaml.emit, then verifies the emitted text parses back into the expected mapping with both keys and matching scalar values.
PyYAML safe_dump with allow_unicode=True round-trips multi-byte emoji scalars verbatim Original / libyaml / usage-python3-yaml-emoji-utf8-roundtrip-batch18 Passed
Calls yaml.safe_dump with allow_unicode=True on a dict containing emoji code points outside the BMP and a CJK string, verifies the emitted text contains the literal multi-byte characters (not \\uXXXX escapes), then reloads with yaml.safe_load and confirms exact equality with the original strings as well as preservation of Python str length (code-point count) and UTF-8 byte length.
PyYAML add_multi_representer routes an enum.Enum subclass to its name Original / libyaml / usage-python3-yaml-enum-representer-batch17 Passed
Defines an enum.Enum subclass, registers SafeDumper.add_multi_representer against enum.Enum that emits each member as its .name string, and verifies the dumped YAML lists the enum names verbatim and round-trips through yaml.safe_load to the corresponding plain strings.
PyYAML error Original / libyaml / usage-python3-yaml-error Passed
PyYAML events Original / libyaml / usage-python3-yaml-events Passed
PyYAML explicit end marker Original / libyaml / usage-python3-yaml-explicit-end Passed
PyYAML explicit document start Original / libyaml / usage-python3-yaml-explicit-start Passed
PyYAML nested flow sequence Original / libyaml / usage-python3-yaml-flow-sequence-nested-batch11 Passed
PyYAML flow style dump Original / libyaml / usage-python3-yaml-flow-style Passed
PyYAML folded scalar Original / libyaml / usage-python3-yaml-folded-scalar Passed
PyYAML full load hex int Original / libyaml / usage-python3-yaml-full-load-hex-int Passed
Fully loads a hexadecimal scalar with PyYAML and verifies it is decoded to the expected integer value.
PyYAML full load scientific number Original / libyaml / usage-python3-yaml-full-load-scientific Passed
PyYAML full load timestamp Original / libyaml / usage-python3-yaml-full-load-timestamp Passed
PyYAML FullLoader boolean Original / libyaml / usage-python3-yaml-full-loader-bool Passed
PyYAML FullLoader on a complex document Original / libyaml / usage-python3-yaml-full-loader-complex-doc-batch13 Passed
Loads a complex document with mixed mappings, sequences, dates, and bools using yaml.FullLoader and verifies the resulting Python types.
PyYAML FullLoader date Original / libyaml / usage-python3-yaml-full-loader-date Passed
PyYAML SafeLoader.add_implicit_resolver matches IPv4 dotted-quad scalars Original / libyaml / usage-python3-yaml-implicit-resolver-ipv4-batch18 Passed
Subclasses yaml.SafeLoader and registers an add_implicit_resolver bound to a fresh "!ipv4" tag with a dotted-quad regex and the digit "first" set, paired with a constructor that wraps the raw scalar in a tagged tuple. Verifies plain scalars matching the IPv4 pattern are dispatched to the constructor while non-matching scalars (a hostname, a plain word) keep the default string tag, and that the regex does not collide with PyYAML's built-in float resolver because the input has more than one dot.
PyYAML MarkedYAMLError exposes problem_mark line and column for a malformed document Original / libyaml / usage-python3-yaml-marked-error-line-batch18 Passed
Feeds a deliberately malformed YAML document (mixed flow-block sequence) to yaml.safe_load, catches the resulting yaml.YAMLError (a MarkedYAMLError subclass), and verifies the exception carries a problem_mark attribute with line and column attributes, that the error class is a subclass of yaml.YAMLError, and that re-raising as a yaml.MarkedYAMLError still surfaces the same coordinates so callers can render contextual error reports.
PyYAML merge key resolution via CSafeLoader with jq verification Original / libyaml / usage-python3-yaml-merge-key-resolution-jq Passed
Resolves a YAML merge key with CSafeLoader, dumps the result as JSON, and uses jq to confirm inherited fields and overrides.
PyYAML merge keys Original / libyaml / usage-python3-yaml-merge-keys Passed
PyYAML custom representer serializes a NamedTuple as a sequence Original / libyaml / usage-python3-yaml-namedtuple-representer-batch17 Passed
Registers a SafeDumper representer that emits a typing.NamedTuple instance as a flow sequence of its field values, dumps two instances, and verifies the output is parsed back into the same Python tuple values via yaml.safe_load.
PyYAML !!omap preserves entry order through SafeLoader Original / libyaml / usage-python3-yaml-omap-roundtrip-batch17 Passed
Loads a YAML document carrying the !!omap tag with three keys in non-sorted order through yaml.safe_load and verifies the resulting list of two-tuples retains the source order, then re-dumps the data and confirms the second parse yields the same payload.
PyYAML !!pairs constructs a list of two-tuples preserving duplicates Original / libyaml / usage-python3-yaml-pairs-construction-batch17 Passed
Loads a YAML sequence tagged with !!pairs containing duplicate keys via yaml.safe_load and verifies the result is a list of two-element tuples that preserves both duplicate keys and the original ordering.
PyYAML parse alias event Original / libyaml / usage-python3-yaml-parse-alias-event Passed
PyYAML parse event count Original / libyaml / usage-python3-yaml-parse-event-count Passed
PyYAML parse event order Original / libyaml / usage-python3-yaml-parse-event-order-batch11 Passed
PyYAML parse event stream contains expected event types Original / libyaml / usage-python3-yaml-parse-events-stream Passed
Drives yaml.parse against a small mapping document and verifies the stream begins with StreamStartEvent, contains MappingStartEvent and ScalarEvent values, and ends with StreamEndEvent.
PyYAML parse events Original / libyaml / usage-python3-yaml-parse-events Passed
PyYAML parse mapping start Original / libyaml / usage-python3-yaml-parse-mapping-start Passed
PyYAML parse on a multi-doc stream emits exactly one StreamEndEvent Original / libyaml / usage-python3-yaml-parse-multidoc-single-streamend-batch15 Passed
Drives yaml.parse against a three-document stream separated by --- and verifies the event sequence has exactly one StreamStartEvent, exactly one StreamEndEvent, and exactly three DocumentStartEvent / DocumentEndEvent pairs interleaved between them.
PyYAML quoted colon string Original / libyaml / usage-python3-yaml-quoted-colon-string-batch11 Passed
PyYAML CSafeLoader preserves identity of an aliased list Original / libyaml / usage-python3-yaml-r10-cload-anchor-shared-list-identity Passed
Loads a document where two mapping keys reference the same anchored sequence via the C-backed loader and asserts both values are the same list object via the Python `is` operator (not just equal), proving alias resolution shares storage rather than deep-copying.
PyYAML CSafeDumper with default_flow_style=True emits flow collections Original / libyaml / usage-python3-yaml-r10-csafedumper-default-flow-style-true Passed
Dumps a nested dict via CSafeDumper with default_flow_style=True and asserts the emitted text uses flow-mapping braces and flow-sequence brackets rather than block-style indented form, then reloads via CSafeLoader and confirms equality.
PyYAML yaml.dump default_style='"' wraps scalars in double quotes Original / libyaml / usage-python3-yaml-r10-dump-default-style-double-quote Passed
Dumps a mapping of strings with default_style='"' and asserts every value scalar in the output is enclosed in double quotes, then reloads via SafeLoader and confirms equality with the source dict.
PyYAML yaml.dump with encoding='utf-8' returns bytes Original / libyaml / usage-python3-yaml-r10-dump-encoding-utf8-bytes Passed
Calls yaml.safe_dump with encoding='utf-8' on a dict containing non-ASCII characters and asserts the return value is bytes whose UTF-8 decoding contains the original characters and reloads to the source dict.
PyYAML FullLoader resolves !!python/tuple to a Python tuple Original / libyaml / usage-python3-yaml-r10-fullloader-python-tuple-roundtrip Passed
Loads a document with an explicit !!python/tuple tag via yaml.FullLoader and asserts the value is a tuple of three ints, then roundtrips via yaml.dump and reloads to confirm the same tuple shape comes back.
PyYAML compose resolves !ex! prefix from input %TAG directive Original / libyaml / usage-python3-yaml-r10-load-tag-prefix-directive Passed
Composes a document containing a %TAG !ex! tag:example.com,2026: directive and a scalar tagged !ex!greeting, then verifies the composed ScalarNode tag string equals the fully-resolved tag:example.com,2026:greeting URI rather than the !ex!greeting handle form.
PyYAML SafeLoader.resolve maps implicit numeric scalars to !!int Original / libyaml / usage-python3-yaml-r10-resolver-resolve-int-implicit Passed
Constructs a SafeLoader instance and calls its resolve method on ScalarNode with values "42" and "3.14", asserting the int and float YAML 1.1 implicit tags are returned, while a generic word resolves to !!str.
PyYAML safe_load of empty / whitespace / comment-only inputs returns None Original / libyaml / usage-python3-yaml-r10-safeload-empty-doc-returns-none Passed
Calls yaml.safe_load on the empty string, a whitespace-only string, a comment-only string, and an explicit document marker with no content, asserting each returns Python None rather than raising or returning an empty container.
PyYAML yaml.scan emits DirectiveToken for %YAML 1.1 Original / libyaml / usage-python3-yaml-r10-scan-directive-yaml-version Passed
Scans a document beginning with %YAML 1.1 and asserts the emitted token stream contains a DirectiveToken whose name attribute is 'YAML' and whose value is the (1, 1) tuple.
PyYAML YAMLObject subclass roundtrips via its yaml_tag Original / libyaml / usage-python3-yaml-r10-yamlobject-subclass-roundtrip Passed
Defines a Python class that inherits yaml.YAMLObject with a custom yaml_tag, dumps an instance via yaml.dump, asserts the emitted document carries the declared tag, and reloads it with yaml.Loader to recover an instance whose attribute matches the original.
PyYAML compose preserves block-literal style on ScalarNode Original / libyaml / usage-python3-yaml-r11-compose-literal-block-scalar-style Passed
Composes a mapping whose value uses the | block-literal style and asserts the resulting ScalarNode has style attribute equal to '|', distinguishing it from folded '>' or default plain scalars.
PyYAML round-trips a small float through scientific-notation YAML Original / libyaml / usage-python3-yaml-r11-dump-float-scientific-notation-roundtrip Passed
Loads the scientific-notation float 1.5e-10 from a YAML scalar, dumps it via yaml.safe_dump, reloads the dumped form, and asserts the value is preserved exactly (bit-equal) and remains a Python float across the round-trip.
PyYAML parse marks SequenceStartEvent.flow_style True for flow input Original / libyaml / usage-python3-yaml-r11-parse-sequence-flow-style-true-event Passed
Parses a flow-style sequence "[1, 2, 3]" via yaml.parse and asserts the SequenceStartEvent emitted carries flow_style=True, with three intermediate ScalarEvents and a SequenceEndEvent — distinguishing flow-source events from block sequences.
PyYAML safe_dump represents a Python tuple as a block sequence Original / libyaml / usage-python3-yaml-r11-safe-dump-tuple-as-block-sequence Passed
Calls yaml.safe_dump on a 3-tuple and asserts the output is the canonical block sequence "- 1\n- 2\n- 3\n" — confirming SafeDumper falls back to the list representer for tuples instead of emitting a !!python/tuple tag.
PyYAML safe_load accepts a UTF-8 bytes object as input Original / libyaml / usage-python3-yaml-r11-safe-load-bytes-input-utf8 Passed
Calls yaml.safe_load with a bytes (not str) source containing UTF-8 encoded ASCII, and asserts the parser decodes and returns the same dict produced from the equivalent str input — exercising the bytes-input branch of the loader stack.
PyYAML safe_load raises ConstructorError on unhashable complex mapping key Original / libyaml / usage-python3-yaml-r11-safe-load-complex-key-unhashable-error Passed
Loads a document using YAML 1.1 explicit complex-key syntax with a flow sequence as the key and asserts safe_load raises ConstructorError with the "found unhashable key" diagnostic — the well-defined behavior for keys that cannot be Python dict keys.
PyYAML safe_load parses 1_000_000 as Python int 1000000 Original / libyaml / usage-python3-yaml-r11-safe-load-int-with-underscores Passed
Loads a document with the YAML 1.1 underscore-delimited integer literal 1_000_000 and asserts safe_load returns the int 1000000, confirming the digit-grouping syntax round-trips through the SafeLoader's implicit int resolver.
PyYAML safe_load returns tz-aware datetime for ISO 8601 timestamp ending in Z Original / libyaml / usage-python3-yaml-r11-safe-load-iso8601-utc-tz-aware Passed
Loads a scalar of the form 2024-01-15T12:00:00Z and confirms safe_load returns a datetime with tzinfo equal to UTC, distinguishing it from naive timestamp parsing.
PyYAML safe_load rejects !!python/object/apply tag Original / libyaml / usage-python3-yaml-r11-safeloader-rejects-python-object Passed
Confirms yaml.safe_load raises ConstructorError when fed a document containing the !!python/object/apply tag, the canonical CVE-2017-18342 payload shape that pre-5.1 PyYAML deserialised into arbitrary callables.
PyYAML scan emits BlockMappingStartToken and BlockEndToken for block mapping Original / libyaml / usage-python3-yaml-r11-scan-block-mapping-end-tokens Passed
Tokenises a two-key block mapping via yaml.scan and asserts the token sequence opens with BlockMappingStartToken, closes with BlockEndToken before StreamEndToken, and contains exactly two KeyToken / ValueToken pairs.
PyYAML BaseLoader returns "42" as a string, not int Original / libyaml / usage-python3-yaml-r12-base-loader-leaves-int-as-string Passed
Loads the scalar 42 with the BaseLoader and asserts the result is the string "42" with no implicit type resolution, distinguishing it from SafeLoader which would coerce to Python int.
PyYAML safe_dump canonical=True emits explicit !!str / !!int tags Original / libyaml / usage-python3-yaml-r12-dump-canonical-explicit-tags Passed
Dumps a small mapping with canonical=True and asserts the canonical form embeds explicit !!str and !!int tag URIs, distinguishing canonical output from compact safe_dump default output.
PyYAML safe_dump with default_flow_style=True emits inline flow form Original / libyaml / usage-python3-yaml-r12-dump-default-flow-style-true-inline Passed
Dumps a nested dict with default_flow_style=True and asserts the output uses inline {} and [] flow markers rather than block style, then reloads to confirm the round-trip preserves values.
PyYAML YAMLError on bad indent reports problem mark with line and column Original / libyaml / usage-python3-yaml-r12-error-mark-line-column Passed
Triggers a parse error with a deliberately mis-indented mapping value, catches the resulting YAMLError, and asserts the problem_mark exposes integer .line and .column attributes pointing into the broken document.
PyYAML parse emits one DocumentStartEvent and DocumentEndEvent per document Original / libyaml / usage-python3-yaml-r12-parse-document-start-end-events Passed
Parses a three-document YAML stream and asserts the event stream contains exactly three DocumentStartEvent and three DocumentEndEvent occurrences flanked by a single StreamStart/StreamEnd pair.
PyYAML safe_load_all yields three documents in order Original / libyaml / usage-python3-yaml-r12-safe-load-all-list-three-docs Passed
Iterates safe_load_all over a three-document stream and asserts the resulting list has exactly three elements in stream order, with each document a distinct dict.
PyYAML safe_load constructs Python set from !!set tag Original / libyaml / usage-python3-yaml-r12-safe-load-explicit-set-tag Passed
Loads a mapping value tagged with !!set whose keys are null-valued and asserts safe_load returns a Python set containing exactly those keys, exercising the SafeConstructor !!set handler.
PyYAML safe_load merge key lets explicit keys override merged base Original / libyaml / usage-python3-yaml-r12-safe-load-merge-key-overrides-base Passed
Loads a YAML mapping that uses the << merge key to inherit from an anchored base while overriding one of its keys, and asserts the explicit override wins over the merged value while other inherited keys are preserved.
PyYAML safe_load resolves sexagesimal "1:30" to int 90 Original / libyaml / usage-python3-yaml-r12-safe-load-sexagesimal-int-rejected Passed
Loads the scalar 1:30 with safe_load and asserts the result is the YAML 1.1 sexagesimal integer 90, locking in PyYAML's continued YAML 1.1 sexagesimal resolution under the safe loader on noble. (Earlier rounds expected the 1.2-style string "1:30"; PyYAML 6.x in noble still emits 90.)
PyYAML safe_load resolves YAML 1.1 "yes"/"no" to Python booleans Original / libyaml / usage-python3-yaml-r12-safe-load-yes-no-as-strings Passed
Loads scalars yes/no/true/false with safe_load and asserts that yes/no map to True/False alongside the spec-true true/false aliases, locking in PyYAML's continued YAML 1.1 boolean resolver on noble. (Earlier rounds expected yes/no to drop to plain strings under YAML 1.2 semantics; PyYAML 6.x still resolves them.)
PyYAML safe_load anchored list and alias point at the same object Original / libyaml / usage-python3-yaml-r13-anchor-alias-shared-list-identity Passed
Loads a mapping where one key carries an anchored list and a second key references that anchor with a star alias, and asserts both values are not just equal but the identical Python object via the is operator.
PyYAML safe_load resolves .inf, -.inf and .nan to Python float specials Original / libyaml / usage-python3-yaml-r13-float-special-inf-nan-resolve Passed
Loads the three YAML 1.1 float specials (.inf, -.inf, .nan) and asserts safe_load returns the corresponding IEEE-754 Python floats: positive infinity, negative infinity, and a NaN that compares not-equal to itself.
PyYAML safe_load folded block scalar joins single line breaks with a single space Original / libyaml / usage-python3-yaml-r13-folded-block-scalar-joins-with-space Passed
Loads a folded (>) block scalar with three contiguous content lines and asserts the loaded value collapses the line breaks between them into single ASCII spaces, terminating with one trailing newline under default clip chomping.
PyYAML safe_load preserves a literal block scalar with default clip chomping Original / libyaml / usage-python3-yaml-r13-literal-block-scalar-clip-default Passed
Loads a literal block scalar written with the default clip-chomping indicator and asserts the value preserves embedded newlines verbatim while collapsing the trailing run of empty lines into a single final newline, distinguishing clip from strip and keep behaviour.
PyYAML safe_load resolves all five null spellings to Python None Original / libyaml / usage-python3-yaml-r13-null-variants-all-resolve-to-none Passed
Loads a mapping whose values exercise the five YAML 1.1 null spellings (~, empty, null, Null, NULL) and asserts safe_load resolves every one of them to the singleton Python None.
PyYAML safe_load !!omap returns a list of (key, value) tuples in declared order Original / libyaml / usage-python3-yaml-r13-omap-tag-list-of-pairs Passed
Loads a sequence tagged with !!omap whose elements are single-key mappings and asserts safe_load yields a Python list of (key, value) tuples preserving the declared order, exercising the SafeConstructor !!omap handler that flattens omap entries into 2-tuples.
PyYAML safe_dump allow_unicode=True writes non-ASCII characters verbatim Original / libyaml / usage-python3-yaml-r13-safe-dump-allow-unicode-non-ascii Passed
Dumps a string containing CJK, Latin-1, and emoji characters with allow_unicode=True and asserts the output contains the exact UTF-8 codepoints rather than backslash-escape forms, then round-trips through safe_load to confirm the result is byte-identical.
PyYAML safe_dump default_style='"' wraps every string scalar in double quotes Original / libyaml / usage-python3-yaml-r13-safe-dump-default-style-double-quote Passed
Dumps a string-only mapping with default_style set to the double-quote indicator and asserts every key and value scalar in the output is surrounded by ASCII double quotes, then round-trips through safe_load to confirm the explicit quoting is reversible.
PyYAML safe_dump indent=4 produces four-space indentation in block output Original / libyaml / usage-python3-yaml-r13-safe-dump-indent-four-block-mapping Passed
Dumps a nested mapping with indent=4 and default_flow_style=False and asserts the resulting block output indents nested keys by exactly four ASCII spaces, distinguishing the indent=4 setting from the default two-space block indentation.
PyYAML ConstructorError and ScannerError both subclass YAMLError Original / libyaml / usage-python3-yaml-r13-yamlerror-base-of-constructor-error Passed
Imports yaml.constructor.ConstructorError and yaml.scanner.ScannerError and asserts both classes are subclasses of yaml.YAMLError, locking in the exception hierarchy that lets callers catch any parse or build error with a single yaml.YAMLError except clause.
PyYAML emit consumes events from parse and reproduces a load-equivalent document Original / libyaml / usage-python3-yaml-r14-emit-from-parse-roundtrip Passed
Pipes the event stream produced by yaml.parse on a small mapping directly into yaml.emit and asserts the regenerated YAML text loads back to the same Python dict as the original — exercising the parse/emit pair without going through the constructor or representer.
PyYAML safe_dump_all emits a "---" separator between two documents Original / libyaml / usage-python3-yaml-r14-safe-dump-all-multidoc-separators Passed
Dumps a list of two distinct mappings via safe_dump_all and asserts the resulting string contains the document separator marker on its own line between the documents, then round-trips the output through safe_load_all to recover both source documents in order.
PyYAML safe_dump default_flow_style=False produces block-style sequences and mappings Original / libyaml / usage-python3-yaml-r14-safe-dump-default-flow-style-false-block Passed
Dumps a mapping whose value is a small list with default_flow_style=False and asserts the output uses block style (no curly or square brackets, one element per line with leading dashes), distinguishing the explicit block-style mode from the autodetect default.
PyYAML safe_load coerces an integer scalar to float when tagged !!float Original / libyaml / usage-python3-yaml-r14-safe-load-explicit-float-tag Passed
Loads a mapping whose value carries an explicit !!float tag on the integer literal 7 and asserts safe_load returns a Python float of value 7.0, exercising the SafeConstructor explicit-tag path that overrides the implicit int resolver.
PyYAML safe_load parses inline flow mapping "{a: 1, b: 2}" into a Python dict Original / libyaml / usage-python3-yaml-r14-safe-load-flow-mapping-curly Passed
Loads a top-level value declared as an inline flow mapping using curly braces and asserts safe_load yields the equivalent Python dict with two int values, exercising the SafeLoader flow-mapping path which is structurally distinct from block-mapping parsing.
PyYAML safe_load parses inline flow sequence "[1, 2, 3]" into a Python list Original / libyaml / usage-python3-yaml-r14-safe-load-flow-sequence-square Passed
Loads a top-level mapping whose value is an inline flow sequence using square brackets and asserts safe_load yields a Python list of three int elements with the declared order, exercising the SafeLoader flow-sequence path that is structurally distinct from block-sequence parsing.
PyYAML safe_load resolves uppercase 0xFF hex literal to decimal int 255 Original / libyaml / usage-python3-yaml-r14-safe-load-hex-uppercase Passed
Loads a mapping whose value is the YAML 1.1 hexadecimal literal 0xFF (uppercase digits) and asserts safe_load returns Python int 255, exercising the implicit int resolver's uppercase-hex regex branch — distinct from existing lowercase 0xff coverage.
PyYAML safe_load preserves an integer larger than 2^64 with full precision Original / libyaml / usage-python3-yaml-r14-safe-load-large-int-arbitrary-precision Passed
Loads a mapping whose value is the 22-digit literal 9999999999999999999999 and asserts safe_load returns a Python int with the exact value (more than 2^64), exercising PyYAML's arbitrary-precision integer support that delegates to Python's native bignum int type.
PyYAML safe_dump quotes a string value containing a colon to keep it a string Original / libyaml / usage-python3-yaml-r14-safe-load-quoted-special-colon-string Passed
Dumps a mapping whose value contains a colon-space sequence (which would be ambiguous as plain YAML) and asserts safe_dump emits the value with single quotes — preventing it from being parsed as a nested mapping — and that the round-tripped value is the original string.
PyYAML serialize consumes a node tree from compose and reproduces a load-equivalent document Original / libyaml / usage-python3-yaml-r14-serialize-from-compose-roundtrip Passed
Composes a mapping into a Node tree with yaml.compose, feeds the root node into yaml.serialize, and asserts the regenerated YAML text loads back to the same Python dict as the original — exercising the compose/serialize pair which sits one level above parse/emit and one level below load/dump.
PyYAML parse exposes ScalarEvent.style==None for plain (unquoted) scalars Original / libyaml / usage-python3-yaml-r15-parse-scalar-event-style-plain Passed
Parses a YAML mapping with a plain unquoted string value and asserts the resulting ScalarEvent for the value has .style == None (PyYAML's marker for plain style) while the .value matches the source text — locking in the parse-event style sentinel for plain scalars on Ubuntu 24.04 PyYAML 6.x. Distinct from the literal/folded compose tests.
PyYAML safe_dump canonical=True emits explicit "!!" tag prefixes for scalars Original / libyaml / usage-python3-yaml-r15-safe-dump-canonical-uses-explicit-tags Passed
Dumps a small mapping with safe_dump(canonical=True) and asserts the output contains explicit YAML tag prefixes (!!str, !!int, !!map) and an explicit document start marker "---" — locking in that the SafeDumper canonical mode writes fully tag-explicit YAML on Ubuntu 24.04 PyYAML 6.x. Distinct from the regular Dumper canonical test (r12).
PyYAML safe_dump default_style="|" emits literal-block-scalar style for strings Original / libyaml / usage-python3-yaml-r15-safe-dump-default-style-pipe-literal Passed
Dumps a multiline string under safe_dump(default_style="|") and asserts the output uses the literal block scalar style (a leading "|" indicator on the value line) rather than quoted or plain — locking in the SafeDumper literal-style explicit-default path on Ubuntu 24.04 PyYAML 6.x. Distinct from the double- and single-quoted default_style tests already covered.
PyYAML safe_dump width=20 wraps a long single string across multiple lines Original / libyaml / usage-python3-yaml-r15-safe-dump-width-narrow-wraps-long-string Passed
Dumps a single long string scalar (well over the requested width) under safe_dump(width=20) and asserts the output spans at least 3 lines — locking in that the SafeDumper honours the narrow width hint by folding long scalars on Ubuntu 24.04 PyYAML 6.x. Loading the output reconstructs the original string.
PyYAML safe_load_all on a fully empty stream produces zero documents Original / libyaml / usage-python3-yaml-r15-safe-load-all-empty-stream-yields-no-docs Passed
Calls safe_load_all on an empty string and asserts the materialised list contains zero documents — locking in that the SafeLoader treats a stream with no document tokens as zero-document on Ubuntu 24.04 PyYAML 6.x, distinct from safe_load on an empty doc (which returns None).
PyYAML safe_load !!binary scalar decodes base64 payload to Python bytes Original / libyaml / usage-python3-yaml-r15-safe-load-binary-tag-decodes-base64 Passed
Loads a YAML mapping value with an explicit !!binary tag and a base64-encoded scalar, and asserts safe_load returns Python bytes equal to the decoded payload — locking in the SafeConstructor !!binary handler on Ubuntu 24.04 PyYAML 6.x.
PyYAML safe_load yields an empty Python dict for an empty flow mapping {} Original / libyaml / usage-python3-yaml-r15-safe-load-empty-flow-mapping-is-dict Passed
Loads a YAML mapping value declared as the empty flow mapping "{}" and asserts safe_load returns a Python dict with len 0 — locking in that the SafeLoader emits an empty dict (not None or an empty list) for the empty flow mapping form on Ubuntu 24.04 PyYAML 6.x. Distinct from the empty document test which exercises a missing root.
PyYAML safe_load yields an empty Python list for an empty flow sequence [] Original / libyaml / usage-python3-yaml-r15-safe-load-empty-flow-sequence-is-list Passed
Loads a YAML mapping value declared as the empty flow sequence "[]" and asserts safe_load returns a Python list with len 0 — locking in that the SafeLoader emits an empty list (not None or an empty dict) for the empty flow sequence form on Ubuntu 24.04 PyYAML 6.x.
PyYAML safe_load YAML 1.1 octal "0o17" stays a string under the int resolver Original / libyaml / usage-python3-yaml-r15-safe-load-octal-zero-prefix Passed
Loads a scalar written in the YAML 1.2 "0o" octal style and asserts safe_load returns the literal Python string "0o17" — locking in that PyYAML 6.x's SafeLoader int resolver matches YAML 1.1 octals (leading "0") and does NOT match the "0o"-prefixed YAML 1.2 form on Ubuntu 24.04. Distinct from the existing "017" YAML 1.1 octal test which decodes to int 15.
PyYAML scan emits a BlockEndToken closing a block mapping Original / libyaml / usage-python3-yaml-r15-scan-block-end-token-present Passed
Scans the token stream for a small block mapping and asserts a BlockEndToken appears in the stream — locking in the SafeLoader scanner emits an explicit block-end marker for indented block mappings on Ubuntu 24.04 PyYAML 6.x. Distinct from the existing block-mapping-end-tokens batch11 test that asserts a count rather than presence-by-class.
PyYAML SafeDumper.add_representer for tuple emits a flow-style sequence Original / libyaml / usage-python3-yaml-r16-add-representer-tuple-as-flow-sequence Passed
Registers a SafeDumper representer that maps Python tuple to a flow-style YAML sequence, dumps a small tuple via yaml.safe_dump, and asserts the output contains the flow-sequence form '[a, b, c]' rather than the block-style hyphen list.
PyYAML compose returns a MappingNode whose .tag is the canonical map tag and which carries the expected number of key/value pairs Original / libyaml / usage-python3-yaml-r16-compose-node-tag-mapping Passed
Calls yaml.compose on a two-key mapping document, asserts the returned object is a MappingNode whose tag equals 'tag:yaml.org,2002:map' and whose .value sequence has length 2 (one entry per key/value pair).
PyYAML safe_load resolves &anchor / *alias references to a shared list object Original / libyaml / usage-python3-yaml-r16-load-anchor-alias-shared-list-roundtrip Passed
Loads a YAML mapping where two keys reference the same anchored sequence and asserts the resulting Python values are not only equal but the exact same object (identity preserved), confirming the SafeConstructor's alias resolution semantics.
PyYAML safe_dump default_flow_style=False emits a block-style mapping (one key per line) Original / libyaml / usage-python3-yaml-r16-safe-dump-default-flow-style-false-block Passed
Dumps a small mapping with default_flow_style=False and asserts the output contains a newline-per-key block-style layout, with no curly-brace flow markers and the expected 'key: value' line for each entry.
PyYAML safe_dump + safe_load preserves a nested dict structure byte-equal to the source mapping Original / libyaml / usage-python3-yaml-r16-safe-dump-nested-dict-roundtrip Passed
Serializes a three-level nested dict with mixed scalar types via yaml.safe_dump and reloads it with yaml.safe_load, then asserts the reloaded object equals the original — covering the canonical safe round-trip path on PyYAML 6.x.
PyYAML safe_dump sort_keys=False preserves the source mapping's insertion order Original / libyaml / usage-python3-yaml-r16-safe-dump-sort-keys-false-preserves-order Passed
Dumps an ordered dict-style mapping with sort_keys=False and asserts the emitted lines appear in the original insertion order (zebra, apple, mango) — not alphabetical (the sort_keys=True default).
PyYAML safe_dump width=20 produces multi-line output for a long flow mapping value Original / libyaml / usage-python3-yaml-r16-safe-dump-width-twenty-wraps-long-string Passed
Dumps a mapping containing a long whitespace-separated string with width=20 and asserts the resulting document spans more than one line and contains no single output line longer than the configured width plus the canonical YAML continuation slack (a few characters).
PyYAML safe_load_all materializes exactly three documents from a triple-doc YAML stream Original / libyaml / usage-python3-yaml-r16-safe-load-all-three-docs-count Passed
Feeds yaml.safe_load_all a stream of three '---'-separated documents (mapping, list, scalar) and asserts the materialized list has length 3 with the expected per-document types and values.
PyYAML SafeLoader raises ConstructorError when given an !!python/object/apply directive Original / libyaml / usage-python3-yaml-r16-safeloader-rejects-python-object-apply Passed
Calls yaml.safe_load on a document containing a !!python/object/apply tag and asserts a yaml.constructor.ConstructorError is raised, locking in the SafeLoader's refusal to materialize arbitrary Python objects on PyYAML 6.x.
PyYAML scan yields a non-empty token stream framed by StreamStart and StreamEnd tokens Original / libyaml / usage-python3-yaml-r16-scan-token-stream-nonempty Passed
Feeds a small mapping document to yaml.scan and asserts the produced token list contains at least one Scalar token and is framed by a StreamStartToken at the start and StreamEndToken at the end — exercising the scanner public API.
PyYAML yaml.compose_all materializes one Node per document in a multi-doc stream Original / libyaml / usage-python3-yaml-r17-compose-all-multidoc-node-count Passed
Composes a triple-document YAML stream via yaml.compose_all, asserts the list has length 3 and that each entry is a yaml.nodes.Node instance — exercising the compose path that produces graph-of-Node objects without resolving Python values.
PyYAML SafeDumper add_representer for a custom class emits a flow mapping that safe_load reads back Original / libyaml / usage-python3-yaml-r17-custom-class-representer-roundtrip Passed
Registers a SafeDumper representer that serializes a small dataclass-like object as a YAML mapping of its fields, dumps an instance through yaml.safe_dump, and asserts the result loads back via yaml.safe_load to the same field dict.
PyYAML yaml.parse over a simple document yields a non-empty event stream including a MappingStartEvent Original / libyaml / usage-python3-yaml-r17-parse-event-stream-nonempty Passed
Feeds yaml.parse a small mapping document, materializes the event iterator into a list, and asserts the resulting events count is at least 5 and includes a MappingStartEvent — exercising the SAX-style parser entry point on top of libyaml.
PyYAML safe_dump allow_unicode=True emits a literal snowman character Original / libyaml / usage-python3-yaml-r17-safe-dump-allow-unicode-snowman Passed
Dumps a mapping containing the U+2603 snowman character with yaml.safe_dump(allow_unicode=True), captures the output, and asserts the literal snowman character appears in the serialized text rather than being escaped to an ASCII escape sequence.
PyYAML safe_dump with explicit_start=True emits a leading '---' document marker Original / libyaml / usage-python3-yaml-r17-safe-dump-explicit-start-emits-triple-dash Passed
Dumps a simple mapping via yaml.safe_dump(explicit_start=True), captures the output, and asserts the first line is exactly '---' followed by the mapping body, exercising the explicit-start option of the emitter.
PyYAML safe_dump with indent=4 emits the nested key with four-space indentation Original / libyaml / usage-python3-yaml-r17-safe-dump-indent-four-nested-mapping Passed
Dumps a nested mapping via yaml.safe_dump(default_flow_style=False, indent=4), captures the output, and asserts the inner key line is indented with exactly four leading spaces — locking in the indent option.
PyYAML safe_dump output of plain types round-trips byte-for-byte through safe_load Original / libyaml / usage-python3-yaml-r17-safe-dump-tag-roundtrip-via-safe-load Passed
Dumps a heterogeneous container of plain types (int, str, bool, None, nested list+dict) via yaml.safe_dump, parses the result back with yaml.safe_load, and asserts the structure matches the original — pinning the safe loader/dumper inverse contract.
PyYAML yaml.scan on empty input emits only the StreamStart/StreamEnd token pair Original / libyaml / usage-python3-yaml-r17-scan-empty-input-empty-token-stream Passed
Feeds yaml.scan an empty string, materializes the token iterator into a list, and asserts the result is exactly the StreamStartToken/StreamEndToken pair (length 2) with no intermediate document content tokens.
PyYAML yaml.serialize over a composed Node round-trips back through safe_load Original / libyaml / usage-python3-yaml-r17-serialize-node-roundtrip Passed
Composes a mapping document to a Node via yaml.compose, re-serializes it via yaml.serialize, and asserts the serialized text loads back via yaml.safe_load to the same Python value — exercising the compose/serialize pair as inverses for safe content.
PyYAML scanner/parser errors share the yaml.YAMLError base class Original / libyaml / usage-python3-yaml-r17-yamlerror-class-hierarchy Passed
Invokes yaml.safe_load on a malformed document containing an unclosed flow-style mapping, captures the raised exception, and asserts the exception is an instance of yaml.YAMLError — pinning the public exception hierarchy contract.
PyYAML safe_load parses an ISO-8601 timestamp into a datetime with expected fields Original / libyaml / usage-python3-yaml-r18-full-load-timestamp-datetime-roundtrip Passed
Loads a YAML scalar of the form '2025-01-02T03:04:05Z' through yaml.safe_load and asserts the resulting Python datetime carries year=2025, month=1, day=2, hour=3, minute=4, second=5 — pinning the libyaml-driven implicit timestamp resolver.
PyYAML yaml.parse emits StreamStartEvent first and StreamEndEvent last Original / libyaml / usage-python3-yaml-r18-parse-event-stream-stream-bounds Passed
Iterates yaml.parse over a small sequence document and asserts the first event is a StreamStartEvent and the last is a StreamEndEvent — pinning the high-level event-stream boundary contract.
PyYAML safe_dump_all writes multiple documents separated by triple-dash markers Original / libyaml / usage-python3-yaml-r18-safe-dump-all-multidoc-separators Passed
Dumps a list of three mappings via yaml.safe_dump_all with explicit_start=True, asserts the output contains exactly three '---' document-start markers, and that safe_load_all reads back the same three documents.
PyYAML safe_dump emits non-ASCII bytes with !!binary tag and safe_load decodes back Original / libyaml / usage-python3-yaml-r18-safe-dump-binary-bytes-tag-roundtrip Passed
Dumps a Python bytes object containing non-ASCII bytes via yaml.safe_dump, verifies the rendered YAML carries an !!binary tag marker, and asserts yaml.safe_load reconstructs the original bytes exactly.
PyYAML safe_dump default_flow_style=True emits a flow-style inline mapping Original / libyaml / usage-python3-yaml-r18-safe-dump-default-flow-style-true-inline Passed
Dumps a small dict via yaml.safe_dump with default_flow_style=True, asserts the rendered output starts with a brace and contains the inline key:value pairs delimited by commas — pinning the flow-style emitter contract.
PyYAML safe_dump sorts mapping keys lexicographically by default Original / libyaml / usage-python3-yaml-r18-safe-dump-sort-keys-true-default Passed
Dumps a Python dict with unsorted insertion-order keys via yaml.safe_dump with default options and asserts the output line order is 'a:', 'b:', 'c:' — pinning the default sort_keys=True behavior.
PyYAML safe_load resolves YAML aliases into the same Python object as their anchor Original / libyaml / usage-python3-yaml-r18-safe-load-anchor-alias-identity Passed
Loads a YAML document where a mapping value is an alias to a previously anchored list via yaml.safe_load, then asserts the two loaded entries are the same Python list object (identity, not just equality).
PyYAML safe_load on !!omap returns ordered (key, value) pairs in document order Original / libyaml / usage-python3-yaml-r18-safe-load-omap-preserves-order Passed
Loads a YAML document with an explicit !!omap tag through yaml.safe_load and asserts the resulting list-of-pairs preserves the source ordering 'c','a','b'.
PyYAML safe_load on !!set tag returns a Python set with the declared members Original / libyaml / usage-python3-yaml-r18-safe-load-set-tag-yields-python-set Passed
Loads a YAML mapping with an explicit !!set tag whose members are alpha, beta, gamma via yaml.safe_load and asserts the resulting value is a Python set equal to {'alpha', 'beta', 'gamma'}.
PyYAML yaml.scan emits StreamStartToken first and StreamEndToken last Original / libyaml / usage-python3-yaml-r18-scan-token-stream-stream-bounds Passed
Calls yaml.scan over a small mapping document and asserts the first token is a StreamStartToken and the last token is a StreamEndToken — pinning the token-stream boundary contract.
PyYAML yaml.dump with CSafeDumper and width=20 wraps a long inline string across lines Original / libyaml / usage-python3-yaml-r19-csafe-dump-width-twenty-wraps Passed
Dumps a mapping containing a 60-character ASCII run via yaml.dump using Dumper=yaml.CSafeDumper with width=20, asserts the emitted output is non-empty and spans at least two lines, and that safe_load reads back the original string — pinning the C-backed emitter width knob.
PyYAML yaml.load with CSafeLoader returns the same dict as Python comparison literal Original / libyaml / usage-python3-yaml-r19-csafe-loader-parses-mapping-equal-to-python-dict Passed
Loads a small inline mapping document via yaml.load(Loader=yaml.CSafeLoader) and asserts the result equals the Python literal {'a': 1, 'b': 2, 'c': 3} — confirming the libyaml C-backend SafeLoader produces canonical Python dicts.
PyYAML safe_dump renders an empty dict as the flow-style '{}' literal Original / libyaml / usage-python3-yaml-r19-safe-dump-empty-mapping-flow-braces Passed
Dumps an empty Python dict via yaml.safe_dump with default options and asserts the stripped output contains the literal '{}' marker — pinning the libyaml emitter's empty-mapping representation contract.
PyYAML safe_dump with indent=2 renders nested mappings with exactly two-space indentation Original / libyaml / usage-python3-yaml-r19-safe-dump-indent-two-nested-mapping Passed
Dumps a two-level nested mapping via yaml.safe_dump(indent=2) and asserts the inner key 'k' appears prefixed by exactly two leading spaces — pinning the safe-dump indent emitter setting.
PyYAML safe_load drops # comments from the loaded document body Original / libyaml / usage-python3-yaml-r19-safe-load-comment-ignored Passed
Loads a YAML document with a # tail comment on a mapping value line via yaml.safe_load and asserts the resulting Python value equals the bare scalar without any '#' character, pinning the libyaml comment-stripping path.
PyYAML safe_load on an empty flow sequence [] yields an empty Python list Original / libyaml / usage-python3-yaml-r19-safe-load-empty-flow-sequence-empty-list Passed
Parses the YAML scalar 'k: []' via yaml.safe_load and asserts the resulting value is a Python list of length zero — pinning the libyaml empty-flow-sequence construction path.
PyYAML safe_load on a single-line flow sequence yields a Python list of ints Original / libyaml / usage-python3-yaml-r19-safe-load-flow-sequence-ints-list Passed
Parses the document 'nums: [4, 8, 15, 16, 23, 42]' via yaml.safe_load and asserts the resulting value is a Python list whose elements are all int and equal to the literal sequence — pinning the libyaml flow-style integer resolver.
PyYAML safe_load joins a double-quoted scalar split across two lines with a single space Original / libyaml / usage-python3-yaml-r19-safe-load-multiline-double-quoted-scalar-joins Passed
Loads a YAML document containing a double-quoted scalar broken across two lines, asserts the resulting Python string is the two halves concatenated with exactly one space — pinning libyaml's double-quoted line-folding contract.
PyYAML safe_load resolves a bare ~ mapping key into Python None Original / libyaml / usage-python3-yaml-r19-safe-load-null-key-as-none Passed
Parses a YAML mapping whose key is the tilde '~' null shorthand, then asserts the resulting Python dict has None as a key bound to the expected value — pinning the libyaml null-key resolution path.
PyYAML safe_load preserves quoted integer-looking scalars as strings Original / libyaml / usage-python3-yaml-r19-safe-load-quoted-scalar-stays-string Passed
Loads a document where a value '"42"' is double-quoted, asserts the resulting Python value is the string '42' rather than the integer 42 — pinning the libyaml quoted-scalar tag resolution path.
PyYAML yaml.dump with CSafeDumper then yaml.safe_load roundtrips a list of mixed scalars Original / libyaml / usage-python3-yaml-r20-csafe-dump-list-roundtrip-equal Passed
Dumps the Python list [1, 'two', 3.5, True, None] via yaml.dump with Dumper=yaml.CSafeDumper, then loads it back with yaml.safe_load and asserts the recovered value is equal to the original list element-by-element and type-by-type — pinning the C-backed emitter/parser path for mixed-type sequences.
PyYAML safe_dump on a list of three strings emits three '- ' block-style lines Original / libyaml / usage-python3-yaml-r20-safe-dump-list-of-three-strings-block Passed
Dumps the Python list ['alpha', 'beta', 'gamma'] via yaml.safe_dump with default_flow_style=False and asserts the output contains the lines '- alpha', '- beta', '- gamma' in order — pinning the libyaml emitter's block-sequence dash prefix.
PyYAML safe_dump default_style='\"' wraps a scalar in double quotes Original / libyaml / usage-python3-yaml-r20-safe-dump-multiline-string-double-quoted Passed
Dumps {'k': 'hello'} via yaml.safe_dump with default_style='"' and asserts the output contains the substring '"hello"' (the double-quoted form of the scalar), pinning the libyaml emitter style override.
PyYAML safe_load_all on a two-document stream returns exactly two parsed documents Original / libyaml / usage-python3-yaml-r20-safe-load-all-two-docs-list-length-two Passed
Feeds 'a: 1\n---\nb: 2\n' to yaml.safe_load_all, collects the iterator into a list and asserts the length is exactly 2 with the documents equal to {'a':1} and {'b':2} in order — pinning libyaml's multi-document iterator.
PyYAML safe_load resolves '1.5e+3' to the Python float 1500.0 Original / libyaml / usage-python3-yaml-r20-safe-load-float-scientific-notation Passed
Parses the document 'val: 1.5e+3' via yaml.safe_load and asserts the resulting value is exactly the Python float 1500.0 of type float — pinning the libyaml YAML 1.1 implicit-resolver float-with-exponent path (which requires an explicit sign on the exponent).
PyYAML safe_load on a '>' folded block scalar joins consecutive lines with a single space Original / libyaml / usage-python3-yaml-r20-safe-load-folded-scalar-joins-with-space Passed
Parses 'k: >\n hello\n world\n' via yaml.safe_load and asserts the resulting string equals 'hello world\n' — pinning libyaml's folded-scalar line-joining contract.
PyYAML safe_load on '-42' yields the Python int -42 Original / libyaml / usage-python3-yaml-r20-safe-load-negative-int-keeps-sign Passed
Parses the document 'n: -42' via yaml.safe_load and asserts the resulting value is the int -42, exactly preserving sign and type — pinning the libyaml-driven negative-integer resolver.
PyYAML safe_load parses a three-deep block mapping into nested dicts Original / libyaml / usage-python3-yaml-r20-safe-load-nested-mapping-depth-three Passed
Parses 'a:\n b:\n c: v\n' via yaml.safe_load and asserts the resulting structure is {'a': {'b': {'c': 'v'}}} with three nested Python dicts, pinning the libyaml block-mapping indentation parser.
PyYAML safe_load preserves a UTF-8 non-ASCII scalar as a Python str Original / libyaml / usage-python3-yaml-r20-safe-load-utf8-non-ascii-scalar-preserved Passed
Feeds 'name: café\n' (UTF-8 encoded) into yaml.safe_load and asserts the value is the Python str 'café', confirming libyaml's UTF-8 scalar decode produces the exact unicode characters.
PyYAML safe_load resolves the bare scalar 'true' to Python bool True Original / libyaml / usage-python3-yaml-r20-safe-load-yes-as-bool-true Passed
Parses 'flag: true' via yaml.safe_load and asserts the value is the Python bool True (type bool, equal to True) — pinning libyaml's YAML 1.1 implicit bool resolver for the 'true' token.
PyYAML safe_dump default_flow_style=None auto-selects block style for a nested mapping Original / libyaml / usage-python3-yaml-r21-safe-dump-default-flow-style-none-autodetect Passed
Calls yaml.safe_dump on a nested dict-of-dict with default_flow_style=None and asserts the output uses block-mapping form (key:\\n inner: value) rather than inline {curly} flow — pinning libyaml's autodetect dumping mode through python3-yaml.
PyYAML safe_dump indent=6 emits a nested block mapping indented by six spaces Original / libyaml / usage-python3-yaml-r21-safe-dump-indent-six-block-mapping Passed
Calls yaml.safe_dump on a nested dict with indent=6 and default_flow_style=False and asserts the inner mapping line begins with at least six spaces — pinning libyaml's emitter indent control through python3-yaml.
PyYAML safe_dump sort_keys=True emits a mapping with keys in alphabetical order Original / libyaml / usage-python3-yaml-r21-safe-dump-sort-keys-true-orders-mapping-keys Passed
Calls yaml.safe_dump on a dict whose insertion order is not alphabetical with sort_keys=True and asserts the emitted lines list the mapping keys in alphabetical order — pinning python3-yaml's sort_keys knob through libyaml's emitter.
PyYAML safe_load_all yields multi-document scalars in the order they appear in the stream Original / libyaml / usage-python3-yaml-r21-safe-load-all-document-order-preserved Passed
Feeds a three-document YAML stream with distinct integer scalars to yaml.safe_load_all and asserts list(safe_load_all(...)) equals the source order — pinning libyaml's multi-doc parsing order through python3-yaml.
PyYAML safe_load decodes a !!binary scalar and PyYAML safe_dump roundtrips back to bytes equal to the original Original / libyaml / usage-python3-yaml-r21-safe-load-binary-tag-base64-roundtrip-bytes Passed
Dumps a known bytes payload via yaml.safe_dump (producing a !!binary base64 scalar), then reloads via yaml.safe_load and asserts the recovered value equals the original bytes — pinning libyaml's binary tag base64 encode/decode roundtrip through python3-yaml.
PyYAML safe_load !!omap yields a list of single-key dicts in declared order Original / libyaml / usage-python3-yaml-r21-safe-load-explicit-omap-tag-yields-list-of-tuples Passed
Parses a document tagged !!omap with three key-value pairs in non-alphabetical order and asserts the result is a list whose entries are single-key dicts preserving the source order — pinning libyaml's !!omap construction through python3-yaml's safe loader.
PyYAML safe_load !!set with mapping-of-nulls yields a Python set of the keys Original / libyaml / usage-python3-yaml-r21-safe-load-explicit-set-tag-yields-python-set Passed
Parses a document tagged !!set whose entries are mapping keys to null and asserts safe_load returns a Python set object equal to {'a', 'b', 'c'} — pinning libyaml's !!set construction through python3-yaml's safe loader.
PyYAML safe_load yields equal mappings for the same data in flow vs block style Original / libyaml / usage-python3-yaml-r21-safe-load-flow-vs-block-equivalent-result Passed
Loads the same data as a block mapping ('a: 1\\nb: 2') and as a flow mapping ('{a: 1, b: 2}') via yaml.safe_load and asserts the two resulting dicts compare equal — pinning libyaml's parser equivalence of flow and block style through python3-yaml.
PyYAML safe_load on malformed YAML raises yaml.YAMLError Original / libyaml / usage-python3-yaml-r21-safe-load-malformed-raises-yamlerror Passed
Feeds a syntactically malformed flow sequence (unbalanced brackets) to yaml.safe_load and asserts the resulting exception is an instance of yaml.YAMLError — pinning libyaml's error-path surfaced as YAMLError through python3-yaml.
PyYAML safe_load preserves object identity for a list anchored once and aliased inside a list-of-list Original / libyaml / usage-python3-yaml-r21-safe-load-shared-anchor-list-identity-deep Passed
Loads a document with a list anchor &xs reused as an item inside another list and asserts both occurrences refer to the same Python list object via 'is' — pinning libyaml's anchor/alias graph reconstruction through python3-yaml's safe loader.
PyYAML safe_load resolves canonical bool tokens Original / libyaml / usage-python3-yaml-r9-bool-canonical-forms Passed
Loads YAML 1.1 bool tokens 'true' and 'false' and asserts they are mapped to Python True/False, while quoted forms remain strings.
PyYAML CSafeLoader and SafeLoader produce identical output Original / libyaml / usage-python3-yaml-r9-cloader-vs-pure Passed
Loads the same YAML document with yaml.SafeLoader and yaml.CSafeLoader (when available) and asserts the parsed structures are equal.
PyYAML safe_dump_all writes multi-document stream Original / libyaml / usage-python3-yaml-r9-dump-all-multidoc Passed
Dumps three dicts via safe_dump_all and verifies the result has two '---' separators and reloads back to the same list.
PyYAML default_flow_style toggles output shape Original / libyaml / usage-python3-yaml-r9-flow-style-default Passed
Dumps the same dict with default_flow_style=False (block) and default_flow_style=True (flow) and asserts only the flow form contains braces.
PyYAML safe_load_all parses multi-document stream Original / libyaml / usage-python3-yaml-r9-load-all-multidoc Passed
Concatenates three YAML documents separated by '---' and asserts safe_load_all yields three dictionaries in order.
PyYAML merge key resolves anchored map Original / libyaml / usage-python3-yaml-r9-merge-key-anchor Passed
Loads a YAML mapping with a merge key '<<' that pulls fields from an anchored mapping, asserting overrides win and missing keys are inherited.
PyYAML safe_dump roundtrip preserves dict Original / libyaml / usage-python3-yaml-r9-safe-dump-roundtrip Passed
PyYAML safe_load handles nested lists of dicts Original / libyaml / usage-python3-yaml-r9-safe-load-nested-list Passed
Loads a small block-style YAML document with a list of mappings via yaml.safe_load and asserts the structure and types match.
PyYAML safe_dump streams to a file object Original / libyaml / usage-python3-yaml-r9-stream-write-fileobj Passed
Opens a temp file for writing, passes it as the stream argument to yaml.safe_dump, and asserts the file content reloads back to the original dict.
PyYAML preserves Unicode strings in roundtrip Original / libyaml / usage-python3-yaml-r9-unicode-roundtrip Passed
Dumps a dict containing multi-byte Unicode strings with allow_unicode=True and reloads, asserting equality and that the dumped text contains the literal characters.
PyYAML dump all three documents Original / libyaml / usage-python3-yaml-safe-dump-all-three-batch11 Passed
PyYAML safe dump allow unicode Original / libyaml / usage-python3-yaml-safe-dump-allow-unicode Passed
Dumps a mapping with allow_unicode enabled in PyYAML and verifies the expected scalar text is emitted.
PyYAML safe dump default style Original / libyaml / usage-python3-yaml-safe-dump-default-style Passed
PyYAML safe dump explicit start Original / libyaml / usage-python3-yaml-safe-dump-explicit-start Passed
Dumps a document with an explicit YAML start marker and verifies the document header is emitted.
PyYAML safe dump flow style Original / libyaml / usage-python3-yaml-safe-dump-flow-style Passed
Dumps a sequence with default_flow_style enabled in PyYAML and verifies the inline flow array is emitted.
PyYAML safe dump indent Original / libyaml / usage-python3-yaml-safe-dump-indent Passed
PyYAML safe dump multiline indent Original / libyaml / usage-python3-yaml-safe-dump-multiline-indent Passed
Dumps a nested mapping with indent=4 in PyYAML and verifies the nested key is emitted with the configured indentation.
PyYAML unicode dump Original / libyaml / usage-python3-yaml-safe-dump-unicode Passed
PyYAML safe dump width Original / libyaml / usage-python3-yaml-safe-dump-width Passed
Safely dumps YAML with a narrow width setting and verifies the emitted text still contains the expected sequence values.
PyYAML SafeLoader rejects !!python/object/apply in load_all Original / libyaml / usage-python3-yaml-safe-load-all-rejects-python-apply-batch13 Passed
Feeds a multi-document stream containing a !!python/object/apply tag into yaml.load_all with SafeLoader and verifies a ConstructorError is raised before any unsafe object is constructed.
PyYAML safe load all three docs Original / libyaml / usage-python3-yaml-safe-load-all-three-docs Passed
Loads a stream of three YAML documents with safe_load_all and verifies each document scalar appears in stream order.
PyYAML safe_load_all Original / libyaml / usage-python3-yaml-safe-load-all Passed
PyYAML SafeLoader on |+ block scalar keeps trailing newlines Original / libyaml / usage-python3-yaml-safe-load-block-keep-chomp-batch16 Passed
Loads a literal block scalar with the keep chomping indicator (|+) through yaml.safe_load and verifies all trailing newlines after the content are preserved verbatim.
PyYAML SafeLoader on |- strips trailing newlines Original / libyaml / usage-python3-yaml-safe-load-block-strip-chomp-batch16 Passed
Loads a literal block scalar with the strip chomping indicator (|-) through yaml.safe_load and verifies all trailing newlines are removed from the resulting string while interior newlines are preserved.
PyYAML safe load bool list Original / libyaml / usage-python3-yaml-safe-load-bool-list Passed
PyYAML safe load float inf Original / libyaml / usage-python3-yaml-safe-load-float-inf Passed
PyYAML safe load flow mapping Original / libyaml / usage-python3-yaml-safe-load-flow-mapping Passed
PyYAML SafeLoader on >+ folded keep preserves trailing newlines Original / libyaml / usage-python3-yaml-safe-load-folded-keep-chomp-batch16 Passed
Loads a folded block scalar with the keep chomping indicator (>+) through yaml.safe_load and verifies that interior newlines are folded into spaces while every trailing newline is preserved verbatim.
PyYAML safe load folded scalar Original / libyaml / usage-python3-yaml-safe-load-folded-scalar Passed
Loads a folded block scalar with PyYAML and verifies line folding into a single space-separated string.
PyYAML safe load hex int Original / libyaml / usage-python3-yaml-safe-load-hex-int Passed
PyYAML safe load integer list Original / libyaml / usage-python3-yaml-safe-load-int-list Passed
PyYAML safe load literal scalar Original / libyaml / usage-python3-yaml-safe-load-literal-scalar Passed
Loads a literal block scalar with PyYAML and verifies that newline characters remain in the resulting string.
PyYAML safe load negative float Original / libyaml / usage-python3-yaml-safe-load-negative-float Passed
PyYAML safe load nested list Original / libyaml / usage-python3-yaml-safe-load-nested-list Passed
PyYAML safe load nested map Original / libyaml / usage-python3-yaml-safe-load-nested-map Passed
PyYAML safe load nested sequence Original / libyaml / usage-python3-yaml-safe-load-nested-sequence Passed
PyYAML safe load no bool Original / libyaml / usage-python3-yaml-safe-load-no-bool Passed
PyYAML safe load null list Original / libyaml / usage-python3-yaml-safe-load-null-list Passed
PyYAML safe_load on tilde null shorthand Original / libyaml / usage-python3-yaml-safe-load-null-tilde-batch14 Passed
Loads each of the canonical null spellings (~, null, Null, NULL, empty) through yaml.safe_load and verifies they all resolve to Python None while a quoted "~" remains a string.
PyYAML safe load octal int Original / libyaml / usage-python3-yaml-safe-load-octal-int Passed
PyYAML safe load ordered keys Original / libyaml / usage-python3-yaml-safe-load-ordered-keys Passed
PyYAML safe_load quoted vs unquoted yes/no Original / libyaml / usage-python3-yaml-safe-load-quoted-yes-string-batch14 Passed
Loads a mapping where yes, no, on, off appear both unquoted and quoted and verifies that PyYAML's bundled YAML 1.1-style bool resolver still coerces unquoted yes/no/on/off to Python bools while quoted forms are forced to strings. Confirms quoting is the only safe way to keep these tokens as strings under safe_load on Ubuntu 24.04.
PyYAML safe load set Original / libyaml / usage-python3-yaml-safe-load-set Passed
PyYAML safe load yes bool Original / libyaml / usage-python3-yaml-safe-load-yes-bool Passed
PyYAML safe load Original / libyaml / usage-python3-yaml-safe-load Passed
PyYAML list round trip Original / libyaml / usage-python3-yaml-safe-roundtrip-list Passed
PyYAML SafeDumper add_representer Original / libyaml / usage-python3-yaml-safedumper-add-representer-batch12 Passed
Registers a custom SafeDumper representer for a str subclass and verifies the emitted output uses the custom tag.
PyYAML SafeLoader honors explicit !!str tag to force string Original / libyaml / usage-python3-yaml-safeloader-explicit-str-tag-batch15 Passed
Loads scalars whose plain form would normally resolve to int or bool ("42", "true") but that are tagged with the explicit core schema tag !!str, and verifies SafeLoader yields a Python str whose value is the unparsed digit/word, while an untagged sibling resolves to its native int/bool.
PyYAML scan anchor token Original / libyaml / usage-python3-yaml-scan-anchor-token Passed
PyYAML scan emits a ScalarToken for a literal block scalar value Original / libyaml / usage-python3-yaml-scan-block-scalar-token-batch15 Passed
Feeds a mapping whose value is a literal-block scalar (introduced by '|') to yaml.scan and verifies a yaml.tokens.ScalarToken is emitted whose value carries the multi-line literal body verbatim, alongside the framing BlockMapping and Key/Value tokens.
PyYAML scan tokens for flow sequence [1,2,3] Original / libyaml / usage-python3-yaml-scan-flow-sequence-tokens-batch13 Passed
Scans the flow sequence "[1,2,3]" with yaml.scan and verifies FlowSequenceStart/End tokens, FlowEntry separators, and three scalar tokens with the expected values.
PyYAML scan key value tokens Original / libyaml / usage-python3-yaml-scan-key-value-tokens-batch12 Passed
Scans a block mapping with PyYAML and verifies BlockMappingStartToken, KeyToken, ValueToken, and ScalarToken values appear in the token stream.
PyYAML yaml.scan emits the expected count of BlockMappingStartTokens Original / libyaml / usage-python3-yaml-scan-mapping-start-token-count-batch16 Passed
Scans a YAML document containing exactly three nested block mappings with yaml.scan and verifies the token stream contains exactly three BlockMappingStartToken instances and at least one StreamStartToken / StreamEndToken pair.
PyYAML scan scalar count Original / libyaml / usage-python3-yaml-scan-scalar-count Passed
PyYAML scan stream tokens Original / libyaml / usage-python3-yaml-scan-stream-tokens-batch11 Passed
PyYAML scan token types Original / libyaml / usage-python3-yaml-scan-token-types Passed
Scans YAML into low-level tokens with PyYAML and verifies the stream-start and scalar token classes are produced.
PyYAML token scanner Original / libyaml / usage-python3-yaml-scan-tokens Passed
PyYAML serialize_all over multiple Node trees Original / libyaml / usage-python3-yaml-serialize-all-multiple-nodes-batch14 Passed
Builds three Node trees by hand and emits them as a single YAML stream with yaml.serialize_all, then verifies the stream contains three explicit document markers and round-trips through yaml.safe_load_all.
PyYAML serialize a constructed Node tree Original / libyaml / usage-python3-yaml-serialize-node-batch13 Passed
Builds a MappingNode/ScalarNode tree by hand and serializes it with yaml.serialize, verifying the emitted YAML round-trips through safe_load.
PyYAML custom !myset representer round-trips a Python set via SafeDumper / SafeLoader Original / libyaml / usage-python3-yaml-set-representer-batch18 Passed
Registers a custom representer on a SafeDumper subclass that emits Python sets as a sorted YAML sequence under a "!myset" tag, plus a paired constructor on a SafeLoader subclass that rebuilds a Python set from the sequence. Verifies the dumped text contains the !myset tag and a deterministic sorted ordering, and that loading reproduces a set with the original membership.
PyYAML sorted dump Original / libyaml / usage-python3-yaml-sorted-dump Passed
PyYAML type preservation for ints floats dates and timestamps Original / libyaml / usage-python3-yaml-type-preservation-jq Passed
Loads a YAML document with int, float, bool, date, and datetime scalars via CSafeLoader and verifies Python types and exact values, plus a jq sanity check on the JSON projection.
PyYAML round-trips uuid.UUID via custom !uuid representer and constructor Original / libyaml / usage-python3-yaml-uuid-roundtrip-batch17 Passed
Registers SafeDumper.add_representer and SafeLoader.add_constructor for the !uuid tag against uuid.UUID, dumps and reloads a fixed UUID4 value, and verifies the loaded object is a uuid.UUID with the original hex.
PyYAML YAMLError catches scanner syntax error Original / libyaml / usage-python3-yaml-yamlerror-syntax-catch-batch12 Passed
Feeds malformed flow content to yaml.safe_load and verifies the raised exception is caught as yaml.YAMLError with a ScannerError subtype.
CVE-2014-9130 libyaml regression Original / libyaml / cve-2014-9130 Passed
Asserts that libyaml reports a normal parse error (not an assertion abort) on the wrapped-scalar simple-key sequence that triggered the scanner.c assertion failure.
YAML anchor alias handling Port / libyaml / anchor-alias-handling Passed
libyaml compile link smoke Port / libyaml / compile-link-smoke Passed
Invalid YAML rejection Port / libyaml / invalid-yaml-rejection Passed
YAML loader dumper cases Port / libyaml / loader-dumper-cases Passed
YAML parser emitter round trip Port / libyaml / parser-emitter-roundtrip Passed
PyYAML yaml.add_constructor module-level API binds a tag on a Loader subclass Port / libyaml / usage-python3-yaml-add-constructor-module-batch18 Passed
Uses the module-level yaml.add_constructor function (rather than calling Loader.add_constructor as a classmethod) with an explicit Loader= argument to register a "!point" constructor that builds a (x, y) tuple from a "x,y" scalar. Verifies the registration is scoped to the supplied loader subclass and that the parent SafeLoader still rejects the unknown !point tag.
PyYAML add_constructor str subclass Port / libyaml / usage-python3-yaml-add-constructor-str-subclass-batch12 Passed
Registers a custom !slug constructor on a SafeLoader subclass and confirms loaded values are instances of the str subclass.
PyYAML SafeLoader add_implicit_resolver for ^0x[0-9a-f]+$ Port / libyaml / usage-python3-yaml-add-implicit-resolver-hex-batch15 Passed
Subclasses yaml.SafeLoader and registers an add_implicit_resolver bound to a fresh "!hex" tag with the regex ^0x[0-9a-f]+$ together with a constructor that parses the hex digits to an int. Verifies plain scalars matching the pattern are wrapped to the integer value while non-matching scalars (decimal ints, plain strings) keep their default tag resolution.
PyYAML yaml.add_multi_constructor dispatches all tags sharing a prefix Port / libyaml / usage-python3-yaml-add-multi-constructor-batch18 Passed
Registers a single multi-constructor for the "!ext:" tag prefix on a SafeLoader subclass so that any tagged scalar whose tag starts with !ext: is routed through one handler that receives the tag suffix. Verifies that two distinct suffixes (!ext:int and !ext:rev) are both dispatched to the same constructor and produce different result objects derived from the suffix.
PyYAML SafeDumper.add_multi_representer covers a class hierarchy Port / libyaml / usage-python3-yaml-add-multi-representer-class-hierarchy-batch16 Passed
Subclasses yaml.SafeDumper, registers add_multi_representer on a base class, and dumps instances of two subclasses verifying both subclass instances are serialized through the inherited representer to the expected scalar form.
PyYAML yaml.add_path_resolver retags a scalar at a fixed mapping path Port / libyaml / usage-python3-yaml-add-path-resolver-mapping-batch18 Passed
Calls yaml.add_path_resolver to register a "!secret" tag that fires whenever a scalar is loaded as the value of the "password" key at the document root, and binds a constructor for !secret that wraps the raw text. Verifies that the path-located scalar receives the custom tag (its constructed value is wrapped) while a sibling key at the same level retains the default string tag.
PyYAML SafeLoader add_implicit_resolver custom scalar tag Port / libyaml / usage-python3-yaml-add-path-resolver-scalar-batch14 Passed
Registers a regex-based implicit resolver on a SafeLoader subclass with a paired custom constructor, then verifies scalars whose plain form matches the pattern are wrapped with a custom Python type while non-matching scalars retain their default integer or string tags. The "path resolver" abstraction in PyYAML is exposed at scalar-resolution time via the same first_in tables, so this exercises the same machinery as add_path_resolver against a single scalar pattern.
PyYAML add_representer for an int subclass Port / libyaml / usage-python3-yaml-add-representer-int-subclass-batch13 Passed
Registers a yaml.add_representer for an int subclass that emits the value as a plain integer scalar, verifying the dumper picks the custom representer instead of failing on the unknown subclass.
PyYAML alias identity Port / libyaml / usage-python3-yaml-alias-identity Passed
PyYAML anchors Port / libyaml / usage-python3-yaml-anchors Passed
PyYAML BaseLoader boolean string Port / libyaml / usage-python3-yaml-base-loader-bool-string Passed
PyYAML base loader integer string Port / libyaml / usage-python3-yaml-base-loader-int-string Passed
PyYAML base loader null string Port / libyaml / usage-python3-yaml-base-loader-null-string Passed
PyYAML binary scalar decoding Port / libyaml / usage-python3-yaml-binary-scalar Passed
PyYAML binary tag base64 round-trip via CSafe backend Port / libyaml / usage-python3-yaml-binary-tag-roundtrip Passed
Round-trips raw bytes through CSafeDumper and CSafeLoader using the !!binary tag and confirms base64 encoding and exact byte recovery.
PyYAML block chomp strip Port / libyaml / usage-python3-yaml-block-chomp-strip-batch11 Passed
PyYAML block scalar Port / libyaml / usage-python3-yaml-block-scalar Passed
PyYAML safe_load consumes a UTF-8 BOM at the start of the stream Port / libyaml / usage-python3-yaml-bom-utf8-load-batch17 Passed
Builds a YAML byte string prefixed with the UTF-8 BOM (EF BB BF) and verifies that yaml.safe_load on the bytes object consumes the BOM and returns the expected mapping with the first key intact and not prefixed by a stray BOM character.
PyYAML CSafeDumper canonical output format Port / libyaml / usage-python3-yaml-canonical-dump-format Passed
Emits a mapping with canonical=True via CSafeDumper and verifies fully-tagged canonical YAML output that round-trips through CSafeLoader.
PyYAML CBaseLoader scalar parsing Port / libyaml / usage-python3-yaml-cbase-loader Passed
PyYAML yaml.CDumper (libyaml-backed full dumper) round-trips a mixed structure Port / libyaml / usage-python3-yaml-cdumper-roundtrip-batch18 Passed
Uses yaml.CDumper, the libyaml-backed C variant of the full dumper, to serialize a mixed Python structure (dict with int, float, list, and bool values), then parses the output back with yaml.CSafeLoader and verifies value-level equality and type preservation across the round-trip.
PyYAML yaml.CLoader (libyaml-backed full loader) parses a nested mapping Port / libyaml / usage-python3-yaml-cloader-mapping-batch18 Passed
Exercises yaml.CLoader, the libyaml-backed C variant of the full loader, by parsing a nested mapping with a list value and a quoted string. Verifies that yaml.CLoader is available (which on Ubuntu 24.04 requires python3-yaml to have been built against libyaml) and that the parsed Python objects match the expected structure and types.
PyYAML compose_all documents Port / libyaml / usage-python3-yaml-compose-all-documents Passed
Composes multiple YAML documents with compose_all and verifies both document roots are available in order.
PyYAML compose preserves anchor identity in resulting Node graph Port / libyaml / usage-python3-yaml-compose-anchor-alias-graph-batch15 Passed
Composes a document that uses an anchor on a mapping and an alias referencing it, then walks the produced yaml.nodes graph and verifies the alias resolves to the same Node object as the anchored mapping (object identity, not just equality).
PyYAML compose document tag Port / libyaml / usage-python3-yaml-compose-document-tag-batch11 Passed
PyYAML compose returns None for empty document Port / libyaml / usage-python3-yaml-compose-empty-document-batch14 Passed
Calls yaml.compose on an empty stream and a stream containing only directives and verifies it returns None for the empty case while compose_all yields the same number of nodes as documents.
PyYAML compose mapping node Port / libyaml / usage-python3-yaml-compose-mapping-node Passed
PyYAML compose with multiline literal scalar value Port / libyaml / usage-python3-yaml-compose-multiline-scalar-batch13 Passed
Composes a mapping whose value is a literal block scalar and verifies the resulting ScalarNode preserves the multiline content with a trailing newline.
PyYAML compose node tag and children Port / libyaml / usage-python3-yaml-compose-node-tag-and-children-batch12 Passed
Composes YAML through PyYAML and verifies the root MappingNode tag plus child ScalarNode tags and values.
PyYAML compose node Port / libyaml / usage-python3-yaml-compose-node Passed
PyYAML compose scalar tag Port / libyaml / usage-python3-yaml-compose-scalar-tag Passed
PyYAML compose sequence length Port / libyaml / usage-python3-yaml-compose-sequence-length Passed
Composes a YAML sequence node with PyYAML and verifies the resulting node contains the expected number of items.
PyYAML compose sequence Port / libyaml / usage-python3-yaml-compose-sequence Passed
PyYAML CSafeLoader and CSafeDumper backend available Port / libyaml / usage-python3-yaml-csafe-backend-available Passed
Confirms PyYAML exposes the libyaml-backed CSafeLoader and CSafeDumper classes and that safe_load is wired to the C backend.
PyYAML CSafeDumper binary Port / libyaml / usage-python3-yaml-csafe-binary-dump Passed
PyYAML CSafeDumper block vs flow output verification Port / libyaml / usage-python3-yaml-csafe-block-vs-flow-output Passed
Emits the same mapping with default_flow_style False and True via CSafeDumper and verifies block style omits braces while flow style uses braces.
PyYAML CSafeDumper explicit end Port / libyaml / usage-python3-yaml-csafe-dump-explicit-end Passed
Dumps multiple YAML documents with explicit end markers and verifies the terminator appears in the emitted text.
PyYAML CSafeDumper explicit start and end markers Port / libyaml / usage-python3-yaml-csafe-dump-explicit-start-end Passed
Dumps a mapping with explicit_start and explicit_end markers using CSafeDumper and verifies both directives appear and round-trip cleanly.
PyYAML CSafeDumper flow style Port / libyaml / usage-python3-yaml-csafe-dump-flow Passed
PyYAML csafe dumper Port / libyaml / usage-python3-yaml-csafe-dumper Passed
PyYAML CSafeLoader flow set Port / libyaml / usage-python3-yaml-csafe-flow-set-batch11 Passed
PyYAML CSafeDumper indent option controls block indentation Port / libyaml / usage-python3-yaml-csafe-indent-option Passed
Dumps a nested mapping with CSafeDumper using indent=6 and verifies six-space indentation is applied and the result round-trips.
PyYAML CSafeLoader load_all three documents jq verified Port / libyaml / usage-python3-yaml-csafe-load-all-three-docs-jq Passed
Streams three YAML documents through CSafeLoader.load_all, dumps them as JSON, and validates each document with jq.
PyYAML CSafeLoader anchor alias Port / libyaml / usage-python3-yaml-csafe-load-anchor-alias Passed
Loads an anchored scalar and its alias through the C-backed PyYAML loader and verifies both keys resolve to the same value.
PyYAML CSafeLoader binary bytes Port / libyaml / usage-python3-yaml-csafe-load-binary-bytes Passed
PyYAML CSafeLoader bool map Port / libyaml / usage-python3-yaml-csafe-load-bool-map Passed
PyYAML CSafeLoader mapping Port / libyaml / usage-python3-yaml-csafe-load-mapping Passed
PyYAML csafe loader Port / libyaml / usage-python3-yaml-csafe-loader Passed
PyYAML CSafeLoader multiple docs Port / libyaml / usage-python3-yaml-csafe-multidoc Passed
PyYAML CSafe round trip dict Port / libyaml / usage-python3-yaml-csafe-roundtrip-dict Passed
PyYAML CSafeLoader sequence Port / libyaml / usage-python3-yaml-csafe-sequence Passed
PyYAML custom dice resolver Port / libyaml / usage-python3-yaml-custom-dice-resolver-batch11 Passed
PyYAML custom representer serializes a dataclass via asdict Port / libyaml / usage-python3-yaml-dataclass-representer-batch17 Passed
Registers a SafeDumper representer that converts a Python dataclass instance into its asdict mapping, dumps a list of two instances, and verifies both are emitted as plain YAML mappings that round-trip back through yaml.safe_load.
PyYAML safe_dump and safe_load round-trip datetime.datetime via the timestamp tag Port / libyaml / usage-python3-yaml-datetime-safedump-roundtrip-batch18 Passed
Calls yaml.safe_dump on a dict whose values are a datetime.datetime and a datetime.date, verifies the emitted text uses the canonical ISO 8601 form (no quoting), and reloads the document via yaml.safe_load to confirm the values come back as the original datetime / date Python objects with full second-precision equality.
PyYAML documents Port / libyaml / usage-python3-yaml-documents Passed
PyYAML dump emits anchor and alias for shared object Port / libyaml / usage-python3-yaml-dump-aliases-cycle-batch13 Passed
Dumps a structure that reuses the same list object twice and verifies yaml.dump emits an anchor (&) on the first occurrence and an alias (*) on the second.
PyYAML dump_all emits --- separators between documents Port / libyaml / usage-python3-yaml-dump-all-document-separators-batch15 Passed
Feeds an iterable of three distinct documents to yaml.dump_all and verifies the output contains exactly two "---" document-start markers separating the three documents (the first document does not require a leading separator). Then re-loads the stream with yaml.safe_load_all and confirms the round-trip yields the original three documents.
PyYAML dump all explicit end Port / libyaml / usage-python3-yaml-dump-all-explicit-end Passed
PyYAML dump_all explicit start Port / libyaml / usage-python3-yaml-dump-all-explicit-start Passed
Dumps multiple YAML documents with explicit document starts and verifies both start markers are emitted.
PyYAML dump_all over multi-document round-trip Port / libyaml / usage-python3-yaml-dump-all-multidoc-roundtrip-batch13 Passed
Dumps a list of documents with yaml.dump_all and verifies safe_load_all reproduces all documents in order.
PyYAML dump emits each scalar style on demand Port / libyaml / usage-python3-yaml-dump-all-scalar-styles-batch15 Passed
Drives yaml.dump with default_style set to each of the documented scalar styles ('"', "'", "", "|", ">") on the same string payload and verifies each style is reflected in the emitted output (double quotes, single quotes, plain, literal block, and folded block respectively).
PyYAML dump allow_unicode=False escapes non-ASCII Port / libyaml / usage-python3-yaml-dump-allow-unicode-false-escape-batch14 Passed
Dumps non-ASCII scalars with yaml.dump allow_unicode=False and verifies PyYAML emits backslash-u escape sequences instead of the literal characters, contrasting with allow_unicode=True.
PyYAML dump allow unicode UTF-8 bytes Port / libyaml / usage-python3-yaml-dump-allow-unicode-utf8-batch12 Passed
Dumps non-ASCII scalars with yaml.dump allow_unicode=True and verifies the literal characters and their UTF-8 encoded bytes appear in the output.
PyYAML yaml.dump emits an anchor and alias for a shared list reference Port / libyaml / usage-python3-yaml-dump-anchor-shared-ref-batch17 Passed
Builds a Python mapping where two keys point at the exact same list object, dumps it with yaml.dump, and verifies a single anchor (&id001) and matching alias (*id001) are emitted so that reloading reproduces the shared reference under SafeLoader.
PyYAML dump roundtrip of arbitrary-precision integer 10**20 Port / libyaml / usage-python3-yaml-dump-bigint-1e20-roundtrip-batch15 Passed
Dumps a Python arbitrary-precision integer (10**20, well beyond int64) with yaml.dump, asserts the emitted scalar is the exact decimal digit string, and verifies yaml.safe_load reads it back as a Python int with the same numeric value.
PyYAML dump forces block style on a list Port / libyaml / usage-python3-yaml-dump-block-style-list-batch14 Passed
Dumps a list two ways via yaml.dump — once with default_flow_style=False forcing block style, once with True forcing flow style — and verifies the block form uses leading hyphens on separate lines while the flow form uses bracketed inline syntax, with both round-tripping to the same Python list.
PyYAML dump bytes via default Dumper emits !!binary Port / libyaml / usage-python3-yaml-dump-bytes-binary-tag-default-batch12 Passed
Dumps a bytes payload through the default yaml.Dumper and verifies the emitted scalar uses the !!binary tag with base64-encoded content that round-trips via full_load.
PyYAML dump default_flow_style=None auto-detects nested vs leaf Port / libyaml / usage-python3-yaml-dump-default-flow-style-none-autodetect-batch15 Passed
Calls yaml.dump with default_flow_style=None on a structure that mixes a leaf list of scalars with a nested mapping containing further structure. Verifies the auto-detect heuristic emits the leaf list inline ([..]) while the outer mapping uses block style (one key per line), in contrast to default_flow_style=False (all block) and =True (all flow).
PyYAML dump default_style single quote Port / libyaml / usage-python3-yaml-dump-default-style-single-quote-batch12 Passed
Dumps mapping values with yaml.dump default_style="'" and verifies every scalar value is wrapped in single quotes.
PyYAML yaml.dump preserves empty list and empty dict in flow style Port / libyaml / usage-python3-yaml-dump-empty-flow-collections-batch16 Passed
Dumps a mapping containing an empty list and an empty dict with default_flow_style=False and verifies the empty collections are emitted in flow form ('[]' and '{}') and round-trip back to identical Python objects.
PyYAML serialize emits explicit non-default sequence tag Port / libyaml / usage-python3-yaml-dump-explicit-seq-tag-batch14 Passed
Builds a yaml.SequenceNode whose tag is a non-default custom tag (!myseq), serializes it through yaml.serialize, and verifies the !myseq tag literal appears verbatim in the rendered YAML alongside the two scalar payloads. The default !!seq tag is elided by the emitter when the resolver would already infer it; this exercises the explicit-tag emission path that round-trips the tag literal into the output stream.
PyYAML dump float inf and nan round-trip Port / libyaml / usage-python3-yaml-dump-float-inf-nan-roundtrip-batch12 Passed
Dumps floating-point infinity and NaN with yaml.dump and verifies the .inf and .nan literal scalars are emitted and round-trip correctly.
PyYAML yaml.dump indent=2 vs 4 vs 8 produce distinct outputs Port / libyaml / usage-python3-yaml-dump-indent-2-4-8-distinct-batch16 Passed
Dumps the same nested mapping three times with indent=2, 4, and 8 and verifies the three serializations differ from each other and use the expected step widths for the inner key.
PyYAML dump with explicit line_break='\n' Port / libyaml / usage-python3-yaml-dump-line-break-control-batch13 Passed
Dumps a mapping with yaml.dump and line_break='\n' and verifies output uses LF line endings exclusively (no CR bytes present).
PyYAML yaml.dump with line_break='\r\n' emits DOS line endings Port / libyaml / usage-python3-yaml-dump-line-break-crlf-batch16 Passed
Dumps a multi-key mapping with line_break set to '\r\n' and verifies every line break in the output uses CRLF and the bytes contain CR characters before each LF.
PyYAML dump nested anchors at multiple levels Port / libyaml / usage-python3-yaml-dump-nested-anchors-multilevel-batch14 Passed
Dumps a structure that shares both an inner mapping and an outer list across multiple keys, and verifies yaml.dump emits two distinct anchors with corresponding aliases.
PyYAML dump nested list of dicts Port / libyaml / usage-python3-yaml-dump-nested-list-of-dicts-batch12 Passed
Dumps a list of dicts with yaml.dump and verifies block-style indentation, dash markers, and full round-trip equality.
PyYAML yaml.dump nested mapping of lists of dicts uses canonical block layout Port / libyaml / usage-python3-yaml-dump-nested-map-of-lists-of-dicts-batch16 Passed
Dumps a mapping whose values are lists of dictionaries with default block style and verifies the exact indentation pattern (top-level key, sequence dash, and nested mapping keys) and round-trips through safe_load.
PyYAML dump preserves OrderedDict insertion order Port / libyaml / usage-python3-yaml-dump-ordered-dict-key-order-batch14 Passed
Registers a representer for collections.OrderedDict on yaml.SafeDumper and verifies yaml.safe_dump emits keys in insertion order rather than alphabetically when sort_keys=False.
PyYAML dump sort keys false Port / libyaml / usage-python3-yaml-dump-sort-keys-false-batch11 Passed
PyYAML dump writes through a passed file-like stream Port / libyaml / usage-python3-yaml-dump-stream-file-like-batch15 Passed
Calls yaml.dump with an explicit stream= argument bound to an opened text-mode file handle, verifies that yaml.dump returns None (no in-memory string), and confirms the same content is materialized on disk via the stream. Then repeats the call with an io.StringIO buffer to confirm the same protocol works for in-memory streams.
PyYAML yaml.dump emits a %TAG directive when tags mapping is supplied Port / libyaml / usage-python3-yaml-dump-tag-directive-batch17 Passed
Calls yaml.dump with explicit_start=True and a tags={'!ex!': 'tag:example.com,2026:'} parameter and verifies the output contains a %TAG directive line mapping the !ex! handle to the provided URI prefix and that the document is still parseable by SafeLoader.
PyYAML dump with %YAML 1.2 version directive Port / libyaml / usage-python3-yaml-dump-version-directive-batch13 Passed
Dumps a mapping with yaml.dump and version=(1, 2) and verifies the %YAML 1.2 directive is emitted in the output stream.
PyYAML yaml.dump with width=10 force-wraps long strings Port / libyaml / usage-python3-yaml-dump-width-10-force-wrap-batch16 Passed
Dumps a mapping containing a long whitespace-bearing string with yaml.dump(width=10) and verifies the emitter wraps the value across multiple lines while still round-tripping back to the original string under safe_load.
PyYAML dump width wraps flow mapping Port / libyaml / usage-python3-yaml-dump-width-flow-mapping-wrap-batch12 Passed
Dumps a flow-style mapping with yaml.dump width=20 and verifies the output wraps onto multiple lines while still round-tripping.
PyYAML dump Port / libyaml / usage-python3-yaml-dump Passed
PyYAML yaml.emit produces YAML from a hand-built event sequence Port / libyaml / usage-python3-yaml-emit-events-stream-batch17 Passed
Builds a yaml.events sequence (StreamStart, DocumentStart, MappingStart, two ScalarEvent pairs, MappingEnd, DocumentEnd, StreamEnd) and feeds it to yaml.emit, then verifies the emitted text parses back into the expected mapping with both keys and matching scalar values.
PyYAML safe_dump with allow_unicode=True round-trips multi-byte emoji scalars verbatim Port / libyaml / usage-python3-yaml-emoji-utf8-roundtrip-batch18 Passed
Calls yaml.safe_dump with allow_unicode=True on a dict containing emoji code points outside the BMP and a CJK string, verifies the emitted text contains the literal multi-byte characters (not \\uXXXX escapes), then reloads with yaml.safe_load and confirms exact equality with the original strings as well as preservation of Python str length (code-point count) and UTF-8 byte length.
PyYAML add_multi_representer routes an enum.Enum subclass to its name Port / libyaml / usage-python3-yaml-enum-representer-batch17 Passed
Defines an enum.Enum subclass, registers SafeDumper.add_multi_representer against enum.Enum that emits each member as its .name string, and verifies the dumped YAML lists the enum names verbatim and round-trips through yaml.safe_load to the corresponding plain strings.
PyYAML error Port / libyaml / usage-python3-yaml-error Passed
PyYAML events Port / libyaml / usage-python3-yaml-events Passed
PyYAML explicit end marker Port / libyaml / usage-python3-yaml-explicit-end Passed
PyYAML explicit document start Port / libyaml / usage-python3-yaml-explicit-start Passed
PyYAML nested flow sequence Port / libyaml / usage-python3-yaml-flow-sequence-nested-batch11 Passed
PyYAML flow style dump Port / libyaml / usage-python3-yaml-flow-style Passed
PyYAML folded scalar Port / libyaml / usage-python3-yaml-folded-scalar Passed
PyYAML full load hex int Port / libyaml / usage-python3-yaml-full-load-hex-int Passed
Fully loads a hexadecimal scalar with PyYAML and verifies it is decoded to the expected integer value.
PyYAML full load scientific number Port / libyaml / usage-python3-yaml-full-load-scientific Passed
PyYAML full load timestamp Port / libyaml / usage-python3-yaml-full-load-timestamp Passed
PyYAML FullLoader boolean Port / libyaml / usage-python3-yaml-full-loader-bool Passed
PyYAML FullLoader on a complex document Port / libyaml / usage-python3-yaml-full-loader-complex-doc-batch13 Passed
Loads a complex document with mixed mappings, sequences, dates, and bools using yaml.FullLoader and verifies the resulting Python types.
PyYAML FullLoader date Port / libyaml / usage-python3-yaml-full-loader-date Passed
PyYAML SafeLoader.add_implicit_resolver matches IPv4 dotted-quad scalars Port / libyaml / usage-python3-yaml-implicit-resolver-ipv4-batch18 Passed
Subclasses yaml.SafeLoader and registers an add_implicit_resolver bound to a fresh "!ipv4" tag with a dotted-quad regex and the digit "first" set, paired with a constructor that wraps the raw scalar in a tagged tuple. Verifies plain scalars matching the IPv4 pattern are dispatched to the constructor while non-matching scalars (a hostname, a plain word) keep the default string tag, and that the regex does not collide with PyYAML's built-in float resolver because the input has more than one dot.
PyYAML MarkedYAMLError exposes problem_mark line and column for a malformed document Port / libyaml / usage-python3-yaml-marked-error-line-batch18 Passed
Feeds a deliberately malformed YAML document (mixed flow-block sequence) to yaml.safe_load, catches the resulting yaml.YAMLError (a MarkedYAMLError subclass), and verifies the exception carries a problem_mark attribute with line and column attributes, that the error class is a subclass of yaml.YAMLError, and that re-raising as a yaml.MarkedYAMLError still surfaces the same coordinates so callers can render contextual error reports.
PyYAML merge key resolution via CSafeLoader with jq verification Port / libyaml / usage-python3-yaml-merge-key-resolution-jq Passed
Resolves a YAML merge key with CSafeLoader, dumps the result as JSON, and uses jq to confirm inherited fields and overrides.
PyYAML merge keys Port / libyaml / usage-python3-yaml-merge-keys Passed
PyYAML custom representer serializes a NamedTuple as a sequence Port / libyaml / usage-python3-yaml-namedtuple-representer-batch17 Passed
Registers a SafeDumper representer that emits a typing.NamedTuple instance as a flow sequence of its field values, dumps two instances, and verifies the output is parsed back into the same Python tuple values via yaml.safe_load.
PyYAML !!omap preserves entry order through SafeLoader Port / libyaml / usage-python3-yaml-omap-roundtrip-batch17 Passed
Loads a YAML document carrying the !!omap tag with three keys in non-sorted order through yaml.safe_load and verifies the resulting list of two-tuples retains the source order, then re-dumps the data and confirms the second parse yields the same payload.
PyYAML !!pairs constructs a list of two-tuples preserving duplicates Port / libyaml / usage-python3-yaml-pairs-construction-batch17 Passed
Loads a YAML sequence tagged with !!pairs containing duplicate keys via yaml.safe_load and verifies the result is a list of two-element tuples that preserves both duplicate keys and the original ordering.
PyYAML parse alias event Port / libyaml / usage-python3-yaml-parse-alias-event Passed
PyYAML parse event count Port / libyaml / usage-python3-yaml-parse-event-count Passed
PyYAML parse event order Port / libyaml / usage-python3-yaml-parse-event-order-batch11 Passed
PyYAML parse event stream contains expected event types Port / libyaml / usage-python3-yaml-parse-events-stream Passed
Drives yaml.parse against a small mapping document and verifies the stream begins with StreamStartEvent, contains MappingStartEvent and ScalarEvent values, and ends with StreamEndEvent.
PyYAML parse events Port / libyaml / usage-python3-yaml-parse-events Passed
PyYAML parse mapping start Port / libyaml / usage-python3-yaml-parse-mapping-start Passed
PyYAML parse on a multi-doc stream emits exactly one StreamEndEvent Port / libyaml / usage-python3-yaml-parse-multidoc-single-streamend-batch15 Passed
Drives yaml.parse against a three-document stream separated by --- and verifies the event sequence has exactly one StreamStartEvent, exactly one StreamEndEvent, and exactly three DocumentStartEvent / DocumentEndEvent pairs interleaved between them.
PyYAML quoted colon string Port / libyaml / usage-python3-yaml-quoted-colon-string-batch11 Passed
PyYAML CSafeLoader preserves identity of an aliased list Port / libyaml / usage-python3-yaml-r10-cload-anchor-shared-list-identity Passed
Loads a document where two mapping keys reference the same anchored sequence via the C-backed loader and asserts both values are the same list object via the Python `is` operator (not just equal), proving alias resolution shares storage rather than deep-copying.
PyYAML CSafeDumper with default_flow_style=True emits flow collections Port / libyaml / usage-python3-yaml-r10-csafedumper-default-flow-style-true Passed
Dumps a nested dict via CSafeDumper with default_flow_style=True and asserts the emitted text uses flow-mapping braces and flow-sequence brackets rather than block-style indented form, then reloads via CSafeLoader and confirms equality.
PyYAML yaml.dump default_style='"' wraps scalars in double quotes Port / libyaml / usage-python3-yaml-r10-dump-default-style-double-quote Passed
Dumps a mapping of strings with default_style='"' and asserts every value scalar in the output is enclosed in double quotes, then reloads via SafeLoader and confirms equality with the source dict.
PyYAML yaml.dump with encoding='utf-8' returns bytes Port / libyaml / usage-python3-yaml-r10-dump-encoding-utf8-bytes Passed
Calls yaml.safe_dump with encoding='utf-8' on a dict containing non-ASCII characters and asserts the return value is bytes whose UTF-8 decoding contains the original characters and reloads to the source dict.
PyYAML FullLoader resolves !!python/tuple to a Python tuple Port / libyaml / usage-python3-yaml-r10-fullloader-python-tuple-roundtrip Passed
Loads a document with an explicit !!python/tuple tag via yaml.FullLoader and asserts the value is a tuple of three ints, then roundtrips via yaml.dump and reloads to confirm the same tuple shape comes back.
PyYAML compose resolves !ex! prefix from input %TAG directive Port / libyaml / usage-python3-yaml-r10-load-tag-prefix-directive Passed
Composes a document containing a %TAG !ex! tag:example.com,2026: directive and a scalar tagged !ex!greeting, then verifies the composed ScalarNode tag string equals the fully-resolved tag:example.com,2026:greeting URI rather than the !ex!greeting handle form.
PyYAML SafeLoader.resolve maps implicit numeric scalars to !!int Port / libyaml / usage-python3-yaml-r10-resolver-resolve-int-implicit Passed
Constructs a SafeLoader instance and calls its resolve method on ScalarNode with values "42" and "3.14", asserting the int and float YAML 1.1 implicit tags are returned, while a generic word resolves to !!str.
PyYAML safe_load of empty / whitespace / comment-only inputs returns None Port / libyaml / usage-python3-yaml-r10-safeload-empty-doc-returns-none Passed
Calls yaml.safe_load on the empty string, a whitespace-only string, a comment-only string, and an explicit document marker with no content, asserting each returns Python None rather than raising or returning an empty container.
PyYAML yaml.scan emits DirectiveToken for %YAML 1.1 Port / libyaml / usage-python3-yaml-r10-scan-directive-yaml-version Passed
Scans a document beginning with %YAML 1.1 and asserts the emitted token stream contains a DirectiveToken whose name attribute is 'YAML' and whose value is the (1, 1) tuple.
PyYAML YAMLObject subclass roundtrips via its yaml_tag Port / libyaml / usage-python3-yaml-r10-yamlobject-subclass-roundtrip Passed
Defines a Python class that inherits yaml.YAMLObject with a custom yaml_tag, dumps an instance via yaml.dump, asserts the emitted document carries the declared tag, and reloads it with yaml.Loader to recover an instance whose attribute matches the original.
PyYAML compose preserves block-literal style on ScalarNode Port / libyaml / usage-python3-yaml-r11-compose-literal-block-scalar-style Passed
Composes a mapping whose value uses the | block-literal style and asserts the resulting ScalarNode has style attribute equal to '|', distinguishing it from folded '>' or default plain scalars.
PyYAML round-trips a small float through scientific-notation YAML Port / libyaml / usage-python3-yaml-r11-dump-float-scientific-notation-roundtrip Passed
Loads the scientific-notation float 1.5e-10 from a YAML scalar, dumps it via yaml.safe_dump, reloads the dumped form, and asserts the value is preserved exactly (bit-equal) and remains a Python float across the round-trip.
PyYAML parse marks SequenceStartEvent.flow_style True for flow input Port / libyaml / usage-python3-yaml-r11-parse-sequence-flow-style-true-event Passed
Parses a flow-style sequence "[1, 2, 3]" via yaml.parse and asserts the SequenceStartEvent emitted carries flow_style=True, with three intermediate ScalarEvents and a SequenceEndEvent — distinguishing flow-source events from block sequences.
PyYAML safe_dump represents a Python tuple as a block sequence Port / libyaml / usage-python3-yaml-r11-safe-dump-tuple-as-block-sequence Passed
Calls yaml.safe_dump on a 3-tuple and asserts the output is the canonical block sequence "- 1\n- 2\n- 3\n" — confirming SafeDumper falls back to the list representer for tuples instead of emitting a !!python/tuple tag.
PyYAML safe_load accepts a UTF-8 bytes object as input Port / libyaml / usage-python3-yaml-r11-safe-load-bytes-input-utf8 Passed
Calls yaml.safe_load with a bytes (not str) source containing UTF-8 encoded ASCII, and asserts the parser decodes and returns the same dict produced from the equivalent str input — exercising the bytes-input branch of the loader stack.
PyYAML safe_load raises ConstructorError on unhashable complex mapping key Port / libyaml / usage-python3-yaml-r11-safe-load-complex-key-unhashable-error Passed
Loads a document using YAML 1.1 explicit complex-key syntax with a flow sequence as the key and asserts safe_load raises ConstructorError with the "found unhashable key" diagnostic — the well-defined behavior for keys that cannot be Python dict keys.
PyYAML safe_load parses 1_000_000 as Python int 1000000 Port / libyaml / usage-python3-yaml-r11-safe-load-int-with-underscores Passed
Loads a document with the YAML 1.1 underscore-delimited integer literal 1_000_000 and asserts safe_load returns the int 1000000, confirming the digit-grouping syntax round-trips through the SafeLoader's implicit int resolver.
PyYAML safe_load returns tz-aware datetime for ISO 8601 timestamp ending in Z Port / libyaml / usage-python3-yaml-r11-safe-load-iso8601-utc-tz-aware Passed
Loads a scalar of the form 2024-01-15T12:00:00Z and confirms safe_load returns a datetime with tzinfo equal to UTC, distinguishing it from naive timestamp parsing.
PyYAML safe_load rejects !!python/object/apply tag Port / libyaml / usage-python3-yaml-r11-safeloader-rejects-python-object Passed
Confirms yaml.safe_load raises ConstructorError when fed a document containing the !!python/object/apply tag, the canonical CVE-2017-18342 payload shape that pre-5.1 PyYAML deserialised into arbitrary callables.
PyYAML scan emits BlockMappingStartToken and BlockEndToken for block mapping Port / libyaml / usage-python3-yaml-r11-scan-block-mapping-end-tokens Passed
Tokenises a two-key block mapping via yaml.scan and asserts the token sequence opens with BlockMappingStartToken, closes with BlockEndToken before StreamEndToken, and contains exactly two KeyToken / ValueToken pairs.
PyYAML BaseLoader returns "42" as a string, not int Port / libyaml / usage-python3-yaml-r12-base-loader-leaves-int-as-string Passed
Loads the scalar 42 with the BaseLoader and asserts the result is the string "42" with no implicit type resolution, distinguishing it from SafeLoader which would coerce to Python int.
PyYAML safe_dump canonical=True emits explicit !!str / !!int tags Port / libyaml / usage-python3-yaml-r12-dump-canonical-explicit-tags Passed
Dumps a small mapping with canonical=True and asserts the canonical form embeds explicit !!str and !!int tag URIs, distinguishing canonical output from compact safe_dump default output.
PyYAML safe_dump with default_flow_style=True emits inline flow form Port / libyaml / usage-python3-yaml-r12-dump-default-flow-style-true-inline Passed
Dumps a nested dict with default_flow_style=True and asserts the output uses inline {} and [] flow markers rather than block style, then reloads to confirm the round-trip preserves values.
PyYAML YAMLError on bad indent reports problem mark with line and column Port / libyaml / usage-python3-yaml-r12-error-mark-line-column Passed
Triggers a parse error with a deliberately mis-indented mapping value, catches the resulting YAMLError, and asserts the problem_mark exposes integer .line and .column attributes pointing into the broken document.
PyYAML parse emits one DocumentStartEvent and DocumentEndEvent per document Port / libyaml / usage-python3-yaml-r12-parse-document-start-end-events Passed
Parses a three-document YAML stream and asserts the event stream contains exactly three DocumentStartEvent and three DocumentEndEvent occurrences flanked by a single StreamStart/StreamEnd pair.
PyYAML safe_load_all yields three documents in order Port / libyaml / usage-python3-yaml-r12-safe-load-all-list-three-docs Passed
Iterates safe_load_all over a three-document stream and asserts the resulting list has exactly three elements in stream order, with each document a distinct dict.
PyYAML safe_load constructs Python set from !!set tag Port / libyaml / usage-python3-yaml-r12-safe-load-explicit-set-tag Passed
Loads a mapping value tagged with !!set whose keys are null-valued and asserts safe_load returns a Python set containing exactly those keys, exercising the SafeConstructor !!set handler.
PyYAML safe_load merge key lets explicit keys override merged base Port / libyaml / usage-python3-yaml-r12-safe-load-merge-key-overrides-base Passed
Loads a YAML mapping that uses the << merge key to inherit from an anchored base while overriding one of its keys, and asserts the explicit override wins over the merged value while other inherited keys are preserved.
PyYAML safe_load resolves sexagesimal "1:30" to int 90 Port / libyaml / usage-python3-yaml-r12-safe-load-sexagesimal-int-rejected Passed
Loads the scalar 1:30 with safe_load and asserts the result is the YAML 1.1 sexagesimal integer 90, locking in PyYAML's continued YAML 1.1 sexagesimal resolution under the safe loader on noble. (Earlier rounds expected the 1.2-style string "1:30"; PyYAML 6.x in noble still emits 90.)
PyYAML safe_load resolves YAML 1.1 "yes"/"no" to Python booleans Port / libyaml / usage-python3-yaml-r12-safe-load-yes-no-as-strings Passed
Loads scalars yes/no/true/false with safe_load and asserts that yes/no map to True/False alongside the spec-true true/false aliases, locking in PyYAML's continued YAML 1.1 boolean resolver on noble. (Earlier rounds expected yes/no to drop to plain strings under YAML 1.2 semantics; PyYAML 6.x still resolves them.)
PyYAML safe_load anchored list and alias point at the same object Port / libyaml / usage-python3-yaml-r13-anchor-alias-shared-list-identity Passed
Loads a mapping where one key carries an anchored list and a second key references that anchor with a star alias, and asserts both values are not just equal but the identical Python object via the is operator.
PyYAML safe_load resolves .inf, -.inf and .nan to Python float specials Port / libyaml / usage-python3-yaml-r13-float-special-inf-nan-resolve Passed
Loads the three YAML 1.1 float specials (.inf, -.inf, .nan) and asserts safe_load returns the corresponding IEEE-754 Python floats: positive infinity, negative infinity, and a NaN that compares not-equal to itself.
PyYAML safe_load folded block scalar joins single line breaks with a single space Port / libyaml / usage-python3-yaml-r13-folded-block-scalar-joins-with-space Passed
Loads a folded (>) block scalar with three contiguous content lines and asserts the loaded value collapses the line breaks between them into single ASCII spaces, terminating with one trailing newline under default clip chomping.
PyYAML safe_load preserves a literal block scalar with default clip chomping Port / libyaml / usage-python3-yaml-r13-literal-block-scalar-clip-default Passed
Loads a literal block scalar written with the default clip-chomping indicator and asserts the value preserves embedded newlines verbatim while collapsing the trailing run of empty lines into a single final newline, distinguishing clip from strip and keep behaviour.
PyYAML safe_load resolves all five null spellings to Python None Port / libyaml / usage-python3-yaml-r13-null-variants-all-resolve-to-none Passed
Loads a mapping whose values exercise the five YAML 1.1 null spellings (~, empty, null, Null, NULL) and asserts safe_load resolves every one of them to the singleton Python None.
PyYAML safe_load !!omap returns a list of (key, value) tuples in declared order Port / libyaml / usage-python3-yaml-r13-omap-tag-list-of-pairs Passed
Loads a sequence tagged with !!omap whose elements are single-key mappings and asserts safe_load yields a Python list of (key, value) tuples preserving the declared order, exercising the SafeConstructor !!omap handler that flattens omap entries into 2-tuples.
PyYAML safe_dump allow_unicode=True writes non-ASCII characters verbatim Port / libyaml / usage-python3-yaml-r13-safe-dump-allow-unicode-non-ascii Passed
Dumps a string containing CJK, Latin-1, and emoji characters with allow_unicode=True and asserts the output contains the exact UTF-8 codepoints rather than backslash-escape forms, then round-trips through safe_load to confirm the result is byte-identical.
PyYAML safe_dump default_style='"' wraps every string scalar in double quotes Port / libyaml / usage-python3-yaml-r13-safe-dump-default-style-double-quote Passed
Dumps a string-only mapping with default_style set to the double-quote indicator and asserts every key and value scalar in the output is surrounded by ASCII double quotes, then round-trips through safe_load to confirm the explicit quoting is reversible.
PyYAML safe_dump indent=4 produces four-space indentation in block output Port / libyaml / usage-python3-yaml-r13-safe-dump-indent-four-block-mapping Passed
Dumps a nested mapping with indent=4 and default_flow_style=False and asserts the resulting block output indents nested keys by exactly four ASCII spaces, distinguishing the indent=4 setting from the default two-space block indentation.
PyYAML ConstructorError and ScannerError both subclass YAMLError Port / libyaml / usage-python3-yaml-r13-yamlerror-base-of-constructor-error Passed
Imports yaml.constructor.ConstructorError and yaml.scanner.ScannerError and asserts both classes are subclasses of yaml.YAMLError, locking in the exception hierarchy that lets callers catch any parse or build error with a single yaml.YAMLError except clause.
PyYAML emit consumes events from parse and reproduces a load-equivalent document Port / libyaml / usage-python3-yaml-r14-emit-from-parse-roundtrip Passed
Pipes the event stream produced by yaml.parse on a small mapping directly into yaml.emit and asserts the regenerated YAML text loads back to the same Python dict as the original — exercising the parse/emit pair without going through the constructor or representer.
PyYAML safe_dump_all emits a "---" separator between two documents Port / libyaml / usage-python3-yaml-r14-safe-dump-all-multidoc-separators Passed
Dumps a list of two distinct mappings via safe_dump_all and asserts the resulting string contains the document separator marker on its own line between the documents, then round-trips the output through safe_load_all to recover both source documents in order.
PyYAML safe_dump default_flow_style=False produces block-style sequences and mappings Port / libyaml / usage-python3-yaml-r14-safe-dump-default-flow-style-false-block Passed
Dumps a mapping whose value is a small list with default_flow_style=False and asserts the output uses block style (no curly or square brackets, one element per line with leading dashes), distinguishing the explicit block-style mode from the autodetect default.
PyYAML safe_load coerces an integer scalar to float when tagged !!float Port / libyaml / usage-python3-yaml-r14-safe-load-explicit-float-tag Passed
Loads a mapping whose value carries an explicit !!float tag on the integer literal 7 and asserts safe_load returns a Python float of value 7.0, exercising the SafeConstructor explicit-tag path that overrides the implicit int resolver.
PyYAML safe_load parses inline flow mapping "{a: 1, b: 2}" into a Python dict Port / libyaml / usage-python3-yaml-r14-safe-load-flow-mapping-curly Passed
Loads a top-level value declared as an inline flow mapping using curly braces and asserts safe_load yields the equivalent Python dict with two int values, exercising the SafeLoader flow-mapping path which is structurally distinct from block-mapping parsing.
PyYAML safe_load parses inline flow sequence "[1, 2, 3]" into a Python list Port / libyaml / usage-python3-yaml-r14-safe-load-flow-sequence-square Passed
Loads a top-level mapping whose value is an inline flow sequence using square brackets and asserts safe_load yields a Python list of three int elements with the declared order, exercising the SafeLoader flow-sequence path that is structurally distinct from block-sequence parsing.
PyYAML safe_load resolves uppercase 0xFF hex literal to decimal int 255 Port / libyaml / usage-python3-yaml-r14-safe-load-hex-uppercase Passed
Loads a mapping whose value is the YAML 1.1 hexadecimal literal 0xFF (uppercase digits) and asserts safe_load returns Python int 255, exercising the implicit int resolver's uppercase-hex regex branch — distinct from existing lowercase 0xff coverage.
PyYAML safe_load preserves an integer larger than 2^64 with full precision Port / libyaml / usage-python3-yaml-r14-safe-load-large-int-arbitrary-precision Passed
Loads a mapping whose value is the 22-digit literal 9999999999999999999999 and asserts safe_load returns a Python int with the exact value (more than 2^64), exercising PyYAML's arbitrary-precision integer support that delegates to Python's native bignum int type.
PyYAML safe_dump quotes a string value containing a colon to keep it a string Port / libyaml / usage-python3-yaml-r14-safe-load-quoted-special-colon-string Passed
Dumps a mapping whose value contains a colon-space sequence (which would be ambiguous as plain YAML) and asserts safe_dump emits the value with single quotes — preventing it from being parsed as a nested mapping — and that the round-tripped value is the original string.
PyYAML serialize consumes a node tree from compose and reproduces a load-equivalent document Port / libyaml / usage-python3-yaml-r14-serialize-from-compose-roundtrip Passed
Composes a mapping into a Node tree with yaml.compose, feeds the root node into yaml.serialize, and asserts the regenerated YAML text loads back to the same Python dict as the original — exercising the compose/serialize pair which sits one level above parse/emit and one level below load/dump.
PyYAML parse exposes ScalarEvent.style==None for plain (unquoted) scalars Port / libyaml / usage-python3-yaml-r15-parse-scalar-event-style-plain Passed
Parses a YAML mapping with a plain unquoted string value and asserts the resulting ScalarEvent for the value has .style == None (PyYAML's marker for plain style) while the .value matches the source text — locking in the parse-event style sentinel for plain scalars on Ubuntu 24.04 PyYAML 6.x. Distinct from the literal/folded compose tests.
PyYAML safe_dump canonical=True emits explicit "!!" tag prefixes for scalars Port / libyaml / usage-python3-yaml-r15-safe-dump-canonical-uses-explicit-tags Passed
Dumps a small mapping with safe_dump(canonical=True) and asserts the output contains explicit YAML tag prefixes (!!str, !!int, !!map) and an explicit document start marker "---" — locking in that the SafeDumper canonical mode writes fully tag-explicit YAML on Ubuntu 24.04 PyYAML 6.x. Distinct from the regular Dumper canonical test (r12).
PyYAML safe_dump default_style="|" emits literal-block-scalar style for strings Port / libyaml / usage-python3-yaml-r15-safe-dump-default-style-pipe-literal Passed
Dumps a multiline string under safe_dump(default_style="|") and asserts the output uses the literal block scalar style (a leading "|" indicator on the value line) rather than quoted or plain — locking in the SafeDumper literal-style explicit-default path on Ubuntu 24.04 PyYAML 6.x. Distinct from the double- and single-quoted default_style tests already covered.
PyYAML safe_dump width=20 wraps a long single string across multiple lines Port / libyaml / usage-python3-yaml-r15-safe-dump-width-narrow-wraps-long-string Passed
Dumps a single long string scalar (well over the requested width) under safe_dump(width=20) and asserts the output spans at least 3 lines — locking in that the SafeDumper honours the narrow width hint by folding long scalars on Ubuntu 24.04 PyYAML 6.x. Loading the output reconstructs the original string.
PyYAML safe_load_all on a fully empty stream produces zero documents Port / libyaml / usage-python3-yaml-r15-safe-load-all-empty-stream-yields-no-docs Passed
Calls safe_load_all on an empty string and asserts the materialised list contains zero documents — locking in that the SafeLoader treats a stream with no document tokens as zero-document on Ubuntu 24.04 PyYAML 6.x, distinct from safe_load on an empty doc (which returns None).
PyYAML safe_load !!binary scalar decodes base64 payload to Python bytes Port / libyaml / usage-python3-yaml-r15-safe-load-binary-tag-decodes-base64 Passed
Loads a YAML mapping value with an explicit !!binary tag and a base64-encoded scalar, and asserts safe_load returns Python bytes equal to the decoded payload — locking in the SafeConstructor !!binary handler on Ubuntu 24.04 PyYAML 6.x.
PyYAML safe_load yields an empty Python dict for an empty flow mapping {} Port / libyaml / usage-python3-yaml-r15-safe-load-empty-flow-mapping-is-dict Passed
Loads a YAML mapping value declared as the empty flow mapping "{}" and asserts safe_load returns a Python dict with len 0 — locking in that the SafeLoader emits an empty dict (not None or an empty list) for the empty flow mapping form on Ubuntu 24.04 PyYAML 6.x. Distinct from the empty document test which exercises a missing root.
PyYAML safe_load yields an empty Python list for an empty flow sequence [] Port / libyaml / usage-python3-yaml-r15-safe-load-empty-flow-sequence-is-list Passed
Loads a YAML mapping value declared as the empty flow sequence "[]" and asserts safe_load returns a Python list with len 0 — locking in that the SafeLoader emits an empty list (not None or an empty dict) for the empty flow sequence form on Ubuntu 24.04 PyYAML 6.x.
PyYAML safe_load YAML 1.1 octal "0o17" stays a string under the int resolver Port / libyaml / usage-python3-yaml-r15-safe-load-octal-zero-prefix Passed
Loads a scalar written in the YAML 1.2 "0o" octal style and asserts safe_load returns the literal Python string "0o17" — locking in that PyYAML 6.x's SafeLoader int resolver matches YAML 1.1 octals (leading "0") and does NOT match the "0o"-prefixed YAML 1.2 form on Ubuntu 24.04. Distinct from the existing "017" YAML 1.1 octal test which decodes to int 15.
PyYAML scan emits a BlockEndToken closing a block mapping Port / libyaml / usage-python3-yaml-r15-scan-block-end-token-present Passed
Scans the token stream for a small block mapping and asserts a BlockEndToken appears in the stream — locking in the SafeLoader scanner emits an explicit block-end marker for indented block mappings on Ubuntu 24.04 PyYAML 6.x. Distinct from the existing block-mapping-end-tokens batch11 test that asserts a count rather than presence-by-class.
PyYAML SafeDumper.add_representer for tuple emits a flow-style sequence Port / libyaml / usage-python3-yaml-r16-add-representer-tuple-as-flow-sequence Passed
Registers a SafeDumper representer that maps Python tuple to a flow-style YAML sequence, dumps a small tuple via yaml.safe_dump, and asserts the output contains the flow-sequence form '[a, b, c]' rather than the block-style hyphen list.
PyYAML compose returns a MappingNode whose .tag is the canonical map tag and which carries the expected number of key/value pairs Port / libyaml / usage-python3-yaml-r16-compose-node-tag-mapping Passed
Calls yaml.compose on a two-key mapping document, asserts the returned object is a MappingNode whose tag equals 'tag:yaml.org,2002:map' and whose .value sequence has length 2 (one entry per key/value pair).
PyYAML safe_load resolves &anchor / *alias references to a shared list object Port / libyaml / usage-python3-yaml-r16-load-anchor-alias-shared-list-roundtrip Passed
Loads a YAML mapping where two keys reference the same anchored sequence and asserts the resulting Python values are not only equal but the exact same object (identity preserved), confirming the SafeConstructor's alias resolution semantics.
PyYAML safe_dump default_flow_style=False emits a block-style mapping (one key per line) Port / libyaml / usage-python3-yaml-r16-safe-dump-default-flow-style-false-block Passed
Dumps a small mapping with default_flow_style=False and asserts the output contains a newline-per-key block-style layout, with no curly-brace flow markers and the expected 'key: value' line for each entry.
PyYAML safe_dump + safe_load preserves a nested dict structure byte-equal to the source mapping Port / libyaml / usage-python3-yaml-r16-safe-dump-nested-dict-roundtrip Passed
Serializes a three-level nested dict with mixed scalar types via yaml.safe_dump and reloads it with yaml.safe_load, then asserts the reloaded object equals the original — covering the canonical safe round-trip path on PyYAML 6.x.
PyYAML safe_dump sort_keys=False preserves the source mapping's insertion order Port / libyaml / usage-python3-yaml-r16-safe-dump-sort-keys-false-preserves-order Passed
Dumps an ordered dict-style mapping with sort_keys=False and asserts the emitted lines appear in the original insertion order (zebra, apple, mango) — not alphabetical (the sort_keys=True default).
PyYAML safe_dump width=20 produces multi-line output for a long flow mapping value Port / libyaml / usage-python3-yaml-r16-safe-dump-width-twenty-wraps-long-string Passed
Dumps a mapping containing a long whitespace-separated string with width=20 and asserts the resulting document spans more than one line and contains no single output line longer than the configured width plus the canonical YAML continuation slack (a few characters).
PyYAML safe_load_all materializes exactly three documents from a triple-doc YAML stream Port / libyaml / usage-python3-yaml-r16-safe-load-all-three-docs-count Passed
Feeds yaml.safe_load_all a stream of three '---'-separated documents (mapping, list, scalar) and asserts the materialized list has length 3 with the expected per-document types and values.
PyYAML SafeLoader raises ConstructorError when given an !!python/object/apply directive Port / libyaml / usage-python3-yaml-r16-safeloader-rejects-python-object-apply Passed
Calls yaml.safe_load on a document containing a !!python/object/apply tag and asserts a yaml.constructor.ConstructorError is raised, locking in the SafeLoader's refusal to materialize arbitrary Python objects on PyYAML 6.x.
PyYAML scan yields a non-empty token stream framed by StreamStart and StreamEnd tokens Port / libyaml / usage-python3-yaml-r16-scan-token-stream-nonempty Passed
Feeds a small mapping document to yaml.scan and asserts the produced token list contains at least one Scalar token and is framed by a StreamStartToken at the start and StreamEndToken at the end — exercising the scanner public API.
PyYAML yaml.compose_all materializes one Node per document in a multi-doc stream Port / libyaml / usage-python3-yaml-r17-compose-all-multidoc-node-count Passed
Composes a triple-document YAML stream via yaml.compose_all, asserts the list has length 3 and that each entry is a yaml.nodes.Node instance — exercising the compose path that produces graph-of-Node objects without resolving Python values.
PyYAML SafeDumper add_representer for a custom class emits a flow mapping that safe_load reads back Port / libyaml / usage-python3-yaml-r17-custom-class-representer-roundtrip Passed
Registers a SafeDumper representer that serializes a small dataclass-like object as a YAML mapping of its fields, dumps an instance through yaml.safe_dump, and asserts the result loads back via yaml.safe_load to the same field dict.
PyYAML yaml.parse over a simple document yields a non-empty event stream including a MappingStartEvent Port / libyaml / usage-python3-yaml-r17-parse-event-stream-nonempty Passed
Feeds yaml.parse a small mapping document, materializes the event iterator into a list, and asserts the resulting events count is at least 5 and includes a MappingStartEvent — exercising the SAX-style parser entry point on top of libyaml.
PyYAML safe_dump allow_unicode=True emits a literal snowman character Port / libyaml / usage-python3-yaml-r17-safe-dump-allow-unicode-snowman Passed
Dumps a mapping containing the U+2603 snowman character with yaml.safe_dump(allow_unicode=True), captures the output, and asserts the literal snowman character appears in the serialized text rather than being escaped to an ASCII escape sequence.
PyYAML safe_dump with explicit_start=True emits a leading '---' document marker Port / libyaml / usage-python3-yaml-r17-safe-dump-explicit-start-emits-triple-dash Passed
Dumps a simple mapping via yaml.safe_dump(explicit_start=True), captures the output, and asserts the first line is exactly '---' followed by the mapping body, exercising the explicit-start option of the emitter.
PyYAML safe_dump with indent=4 emits the nested key with four-space indentation Port / libyaml / usage-python3-yaml-r17-safe-dump-indent-four-nested-mapping Passed
Dumps a nested mapping via yaml.safe_dump(default_flow_style=False, indent=4), captures the output, and asserts the inner key line is indented with exactly four leading spaces — locking in the indent option.
PyYAML safe_dump output of plain types round-trips byte-for-byte through safe_load Port / libyaml / usage-python3-yaml-r17-safe-dump-tag-roundtrip-via-safe-load Passed
Dumps a heterogeneous container of plain types (int, str, bool, None, nested list+dict) via yaml.safe_dump, parses the result back with yaml.safe_load, and asserts the structure matches the original — pinning the safe loader/dumper inverse contract.
PyYAML yaml.scan on empty input emits only the StreamStart/StreamEnd token pair Port / libyaml / usage-python3-yaml-r17-scan-empty-input-empty-token-stream Passed
Feeds yaml.scan an empty string, materializes the token iterator into a list, and asserts the result is exactly the StreamStartToken/StreamEndToken pair (length 2) with no intermediate document content tokens.
PyYAML yaml.serialize over a composed Node round-trips back through safe_load Port / libyaml / usage-python3-yaml-r17-serialize-node-roundtrip Passed
Composes a mapping document to a Node via yaml.compose, re-serializes it via yaml.serialize, and asserts the serialized text loads back via yaml.safe_load to the same Python value — exercising the compose/serialize pair as inverses for safe content.
PyYAML scanner/parser errors share the yaml.YAMLError base class Port / libyaml / usage-python3-yaml-r17-yamlerror-class-hierarchy Passed
Invokes yaml.safe_load on a malformed document containing an unclosed flow-style mapping, captures the raised exception, and asserts the exception is an instance of yaml.YAMLError — pinning the public exception hierarchy contract.
PyYAML safe_load parses an ISO-8601 timestamp into a datetime with expected fields Port / libyaml / usage-python3-yaml-r18-full-load-timestamp-datetime-roundtrip Passed
Loads a YAML scalar of the form '2025-01-02T03:04:05Z' through yaml.safe_load and asserts the resulting Python datetime carries year=2025, month=1, day=2, hour=3, minute=4, second=5 — pinning the libyaml-driven implicit timestamp resolver.
PyYAML yaml.parse emits StreamStartEvent first and StreamEndEvent last Port / libyaml / usage-python3-yaml-r18-parse-event-stream-stream-bounds Passed
Iterates yaml.parse over a small sequence document and asserts the first event is a StreamStartEvent and the last is a StreamEndEvent — pinning the high-level event-stream boundary contract.
PyYAML safe_dump_all writes multiple documents separated by triple-dash markers Port / libyaml / usage-python3-yaml-r18-safe-dump-all-multidoc-separators Passed
Dumps a list of three mappings via yaml.safe_dump_all with explicit_start=True, asserts the output contains exactly three '---' document-start markers, and that safe_load_all reads back the same three documents.
PyYAML safe_dump emits non-ASCII bytes with !!binary tag and safe_load decodes back Port / libyaml / usage-python3-yaml-r18-safe-dump-binary-bytes-tag-roundtrip Passed
Dumps a Python bytes object containing non-ASCII bytes via yaml.safe_dump, verifies the rendered YAML carries an !!binary tag marker, and asserts yaml.safe_load reconstructs the original bytes exactly.
PyYAML safe_dump default_flow_style=True emits a flow-style inline mapping Port / libyaml / usage-python3-yaml-r18-safe-dump-default-flow-style-true-inline Passed
Dumps a small dict via yaml.safe_dump with default_flow_style=True, asserts the rendered output starts with a brace and contains the inline key:value pairs delimited by commas — pinning the flow-style emitter contract.
PyYAML safe_dump sorts mapping keys lexicographically by default Port / libyaml / usage-python3-yaml-r18-safe-dump-sort-keys-true-default Passed
Dumps a Python dict with unsorted insertion-order keys via yaml.safe_dump with default options and asserts the output line order is 'a:', 'b:', 'c:' — pinning the default sort_keys=True behavior.
PyYAML safe_load resolves YAML aliases into the same Python object as their anchor Port / libyaml / usage-python3-yaml-r18-safe-load-anchor-alias-identity Passed
Loads a YAML document where a mapping value is an alias to a previously anchored list via yaml.safe_load, then asserts the two loaded entries are the same Python list object (identity, not just equality).
PyYAML safe_load on !!omap returns ordered (key, value) pairs in document order Port / libyaml / usage-python3-yaml-r18-safe-load-omap-preserves-order Passed
Loads a YAML document with an explicit !!omap tag through yaml.safe_load and asserts the resulting list-of-pairs preserves the source ordering 'c','a','b'.
PyYAML safe_load on !!set tag returns a Python set with the declared members Port / libyaml / usage-python3-yaml-r18-safe-load-set-tag-yields-python-set Passed
Loads a YAML mapping with an explicit !!set tag whose members are alpha, beta, gamma via yaml.safe_load and asserts the resulting value is a Python set equal to {'alpha', 'beta', 'gamma'}.
PyYAML yaml.scan emits StreamStartToken first and StreamEndToken last Port / libyaml / usage-python3-yaml-r18-scan-token-stream-stream-bounds Passed
Calls yaml.scan over a small mapping document and asserts the first token is a StreamStartToken and the last token is a StreamEndToken — pinning the token-stream boundary contract.
PyYAML yaml.dump with CSafeDumper and width=20 wraps a long inline string across lines Port / libyaml / usage-python3-yaml-r19-csafe-dump-width-twenty-wraps Passed
Dumps a mapping containing a 60-character ASCII run via yaml.dump using Dumper=yaml.CSafeDumper with width=20, asserts the emitted output is non-empty and spans at least two lines, and that safe_load reads back the original string — pinning the C-backed emitter width knob.
PyYAML yaml.load with CSafeLoader returns the same dict as Python comparison literal Port / libyaml / usage-python3-yaml-r19-csafe-loader-parses-mapping-equal-to-python-dict Passed
Loads a small inline mapping document via yaml.load(Loader=yaml.CSafeLoader) and asserts the result equals the Python literal {'a': 1, 'b': 2, 'c': 3} — confirming the libyaml C-backend SafeLoader produces canonical Python dicts.
PyYAML safe_dump renders an empty dict as the flow-style '{}' literal Port / libyaml / usage-python3-yaml-r19-safe-dump-empty-mapping-flow-braces Passed
Dumps an empty Python dict via yaml.safe_dump with default options and asserts the stripped output contains the literal '{}' marker — pinning the libyaml emitter's empty-mapping representation contract.
PyYAML safe_dump with indent=2 renders nested mappings with exactly two-space indentation Port / libyaml / usage-python3-yaml-r19-safe-dump-indent-two-nested-mapping Passed
Dumps a two-level nested mapping via yaml.safe_dump(indent=2) and asserts the inner key 'k' appears prefixed by exactly two leading spaces — pinning the safe-dump indent emitter setting.
PyYAML safe_load drops # comments from the loaded document body Port / libyaml / usage-python3-yaml-r19-safe-load-comment-ignored Passed
Loads a YAML document with a # tail comment on a mapping value line via yaml.safe_load and asserts the resulting Python value equals the bare scalar without any '#' character, pinning the libyaml comment-stripping path.
PyYAML safe_load on an empty flow sequence [] yields an empty Python list Port / libyaml / usage-python3-yaml-r19-safe-load-empty-flow-sequence-empty-list Passed
Parses the YAML scalar 'k: []' via yaml.safe_load and asserts the resulting value is a Python list of length zero — pinning the libyaml empty-flow-sequence construction path.
PyYAML safe_load on a single-line flow sequence yields a Python list of ints Port / libyaml / usage-python3-yaml-r19-safe-load-flow-sequence-ints-list Passed
Parses the document 'nums: [4, 8, 15, 16, 23, 42]' via yaml.safe_load and asserts the resulting value is a Python list whose elements are all int and equal to the literal sequence — pinning the libyaml flow-style integer resolver.
PyYAML safe_load joins a double-quoted scalar split across two lines with a single space Port / libyaml / usage-python3-yaml-r19-safe-load-multiline-double-quoted-scalar-joins Passed
Loads a YAML document containing a double-quoted scalar broken across two lines, asserts the resulting Python string is the two halves concatenated with exactly one space — pinning libyaml's double-quoted line-folding contract.
PyYAML safe_load resolves a bare ~ mapping key into Python None Port / libyaml / usage-python3-yaml-r19-safe-load-null-key-as-none Passed
Parses a YAML mapping whose key is the tilde '~' null shorthand, then asserts the resulting Python dict has None as a key bound to the expected value — pinning the libyaml null-key resolution path.
PyYAML safe_load preserves quoted integer-looking scalars as strings Port / libyaml / usage-python3-yaml-r19-safe-load-quoted-scalar-stays-string Passed
Loads a document where a value '"42"' is double-quoted, asserts the resulting Python value is the string '42' rather than the integer 42 — pinning the libyaml quoted-scalar tag resolution path.
PyYAML yaml.dump with CSafeDumper then yaml.safe_load roundtrips a list of mixed scalars Port / libyaml / usage-python3-yaml-r20-csafe-dump-list-roundtrip-equal Passed
Dumps the Python list [1, 'two', 3.5, True, None] via yaml.dump with Dumper=yaml.CSafeDumper, then loads it back with yaml.safe_load and asserts the recovered value is equal to the original list element-by-element and type-by-type — pinning the C-backed emitter/parser path for mixed-type sequences.
PyYAML safe_dump on a list of three strings emits three '- ' block-style lines Port / libyaml / usage-python3-yaml-r20-safe-dump-list-of-three-strings-block Passed
Dumps the Python list ['alpha', 'beta', 'gamma'] via yaml.safe_dump with default_flow_style=False and asserts the output contains the lines '- alpha', '- beta', '- gamma' in order — pinning the libyaml emitter's block-sequence dash prefix.
PyYAML safe_dump default_style='\"' wraps a scalar in double quotes Port / libyaml / usage-python3-yaml-r20-safe-dump-multiline-string-double-quoted Passed
Dumps {'k': 'hello'} via yaml.safe_dump with default_style='"' and asserts the output contains the substring '"hello"' (the double-quoted form of the scalar), pinning the libyaml emitter style override.
PyYAML safe_load_all on a two-document stream returns exactly two parsed documents Port / libyaml / usage-python3-yaml-r20-safe-load-all-two-docs-list-length-two Passed
Feeds 'a: 1\n---\nb: 2\n' to yaml.safe_load_all, collects the iterator into a list and asserts the length is exactly 2 with the documents equal to {'a':1} and {'b':2} in order — pinning libyaml's multi-document iterator.
PyYAML safe_load resolves '1.5e+3' to the Python float 1500.0 Port / libyaml / usage-python3-yaml-r20-safe-load-float-scientific-notation Passed
Parses the document 'val: 1.5e+3' via yaml.safe_load and asserts the resulting value is exactly the Python float 1500.0 of type float — pinning the libyaml YAML 1.1 implicit-resolver float-with-exponent path (which requires an explicit sign on the exponent).
PyYAML safe_load on a '>' folded block scalar joins consecutive lines with a single space Port / libyaml / usage-python3-yaml-r20-safe-load-folded-scalar-joins-with-space Passed
Parses 'k: >\n hello\n world\n' via yaml.safe_load and asserts the resulting string equals 'hello world\n' — pinning libyaml's folded-scalar line-joining contract.
PyYAML safe_load on '-42' yields the Python int -42 Port / libyaml / usage-python3-yaml-r20-safe-load-negative-int-keeps-sign Passed
Parses the document 'n: -42' via yaml.safe_load and asserts the resulting value is the int -42, exactly preserving sign and type — pinning the libyaml-driven negative-integer resolver.
PyYAML safe_load parses a three-deep block mapping into nested dicts Port / libyaml / usage-python3-yaml-r20-safe-load-nested-mapping-depth-three Passed
Parses 'a:\n b:\n c: v\n' via yaml.safe_load and asserts the resulting structure is {'a': {'b': {'c': 'v'}}} with three nested Python dicts, pinning the libyaml block-mapping indentation parser.
PyYAML safe_load preserves a UTF-8 non-ASCII scalar as a Python str Port / libyaml / usage-python3-yaml-r20-safe-load-utf8-non-ascii-scalar-preserved Passed
Feeds 'name: café\n' (UTF-8 encoded) into yaml.safe_load and asserts the value is the Python str 'café', confirming libyaml's UTF-8 scalar decode produces the exact unicode characters.
PyYAML safe_load resolves the bare scalar 'true' to Python bool True Port / libyaml / usage-python3-yaml-r20-safe-load-yes-as-bool-true Passed
Parses 'flag: true' via yaml.safe_load and asserts the value is the Python bool True (type bool, equal to True) — pinning libyaml's YAML 1.1 implicit bool resolver for the 'true' token.
PyYAML safe_dump default_flow_style=None auto-selects block style for a nested mapping Port / libyaml / usage-python3-yaml-r21-safe-dump-default-flow-style-none-autodetect Passed
Calls yaml.safe_dump on a nested dict-of-dict with default_flow_style=None and asserts the output uses block-mapping form (key:\\n inner: value) rather than inline {curly} flow — pinning libyaml's autodetect dumping mode through python3-yaml.
PyYAML safe_dump indent=6 emits a nested block mapping indented by six spaces Port / libyaml / usage-python3-yaml-r21-safe-dump-indent-six-block-mapping Passed
Calls yaml.safe_dump on a nested dict with indent=6 and default_flow_style=False and asserts the inner mapping line begins with at least six spaces — pinning libyaml's emitter indent control through python3-yaml.
PyYAML safe_dump sort_keys=True emits a mapping with keys in alphabetical order Port / libyaml / usage-python3-yaml-r21-safe-dump-sort-keys-true-orders-mapping-keys Passed
Calls yaml.safe_dump on a dict whose insertion order is not alphabetical with sort_keys=True and asserts the emitted lines list the mapping keys in alphabetical order — pinning python3-yaml's sort_keys knob through libyaml's emitter.
PyYAML safe_load_all yields multi-document scalars in the order they appear in the stream Port / libyaml / usage-python3-yaml-r21-safe-load-all-document-order-preserved Passed
Feeds a three-document YAML stream with distinct integer scalars to yaml.safe_load_all and asserts list(safe_load_all(...)) equals the source order — pinning libyaml's multi-doc parsing order through python3-yaml.
PyYAML safe_load decodes a !!binary scalar and PyYAML safe_dump roundtrips back to bytes equal to the original Port / libyaml / usage-python3-yaml-r21-safe-load-binary-tag-base64-roundtrip-bytes Passed
Dumps a known bytes payload via yaml.safe_dump (producing a !!binary base64 scalar), then reloads via yaml.safe_load and asserts the recovered value equals the original bytes — pinning libyaml's binary tag base64 encode/decode roundtrip through python3-yaml.
PyYAML safe_load !!omap yields a list of single-key dicts in declared order Port / libyaml / usage-python3-yaml-r21-safe-load-explicit-omap-tag-yields-list-of-tuples Passed
Parses a document tagged !!omap with three key-value pairs in non-alphabetical order and asserts the result is a list whose entries are single-key dicts preserving the source order — pinning libyaml's !!omap construction through python3-yaml's safe loader.
PyYAML safe_load !!set with mapping-of-nulls yields a Python set of the keys Port / libyaml / usage-python3-yaml-r21-safe-load-explicit-set-tag-yields-python-set Passed
Parses a document tagged !!set whose entries are mapping keys to null and asserts safe_load returns a Python set object equal to {'a', 'b', 'c'} — pinning libyaml's !!set construction through python3-yaml's safe loader.
PyYAML safe_load yields equal mappings for the same data in flow vs block style Port / libyaml / usage-python3-yaml-r21-safe-load-flow-vs-block-equivalent-result Passed
Loads the same data as a block mapping ('a: 1\\nb: 2') and as a flow mapping ('{a: 1, b: 2}') via yaml.safe_load and asserts the two resulting dicts compare equal — pinning libyaml's parser equivalence of flow and block style through python3-yaml.
PyYAML safe_load on malformed YAML raises yaml.YAMLError Port / libyaml / usage-python3-yaml-r21-safe-load-malformed-raises-yamlerror Passed
Feeds a syntactically malformed flow sequence (unbalanced brackets) to yaml.safe_load and asserts the resulting exception is an instance of yaml.YAMLError — pinning libyaml's error-path surfaced as YAMLError through python3-yaml.
PyYAML safe_load preserves object identity for a list anchored once and aliased inside a list-of-list Port / libyaml / usage-python3-yaml-r21-safe-load-shared-anchor-list-identity-deep Passed
Loads a document with a list anchor &xs reused as an item inside another list and asserts both occurrences refer to the same Python list object via 'is' — pinning libyaml's anchor/alias graph reconstruction through python3-yaml's safe loader.
PyYAML safe_load resolves canonical bool tokens Port / libyaml / usage-python3-yaml-r9-bool-canonical-forms Passed
Loads YAML 1.1 bool tokens 'true' and 'false' and asserts they are mapped to Python True/False, while quoted forms remain strings.
PyYAML CSafeLoader and SafeLoader produce identical output Port / libyaml / usage-python3-yaml-r9-cloader-vs-pure Passed
Loads the same YAML document with yaml.SafeLoader and yaml.CSafeLoader (when available) and asserts the parsed structures are equal.
PyYAML safe_dump_all writes multi-document stream Port / libyaml / usage-python3-yaml-r9-dump-all-multidoc Passed
Dumps three dicts via safe_dump_all and verifies the result has two '---' separators and reloads back to the same list.
PyYAML default_flow_style toggles output shape Port / libyaml / usage-python3-yaml-r9-flow-style-default Passed
Dumps the same dict with default_flow_style=False (block) and default_flow_style=True (flow) and asserts only the flow form contains braces.
PyYAML safe_load_all parses multi-document stream Port / libyaml / usage-python3-yaml-r9-load-all-multidoc Passed
Concatenates three YAML documents separated by '---' and asserts safe_load_all yields three dictionaries in order.
PyYAML merge key resolves anchored map Port / libyaml / usage-python3-yaml-r9-merge-key-anchor Passed
Loads a YAML mapping with a merge key '<<' that pulls fields from an anchored mapping, asserting overrides win and missing keys are inherited.
PyYAML safe_dump roundtrip preserves dict Port / libyaml / usage-python3-yaml-r9-safe-dump-roundtrip Passed
PyYAML safe_load handles nested lists of dicts Port / libyaml / usage-python3-yaml-r9-safe-load-nested-list Passed
Loads a small block-style YAML document with a list of mappings via yaml.safe_load and asserts the structure and types match.
PyYAML safe_dump streams to a file object Port / libyaml / usage-python3-yaml-r9-stream-write-fileobj Passed
Opens a temp file for writing, passes it as the stream argument to yaml.safe_dump, and asserts the file content reloads back to the original dict.
PyYAML preserves Unicode strings in roundtrip Port / libyaml / usage-python3-yaml-r9-unicode-roundtrip Passed
Dumps a dict containing multi-byte Unicode strings with allow_unicode=True and reloads, asserting equality and that the dumped text contains the literal characters.
PyYAML dump all three documents Port / libyaml / usage-python3-yaml-safe-dump-all-three-batch11 Passed
PyYAML safe dump allow unicode Port / libyaml / usage-python3-yaml-safe-dump-allow-unicode Passed
Dumps a mapping with allow_unicode enabled in PyYAML and verifies the expected scalar text is emitted.
PyYAML safe dump default style Port / libyaml / usage-python3-yaml-safe-dump-default-style Passed
PyYAML safe dump explicit start Port / libyaml / usage-python3-yaml-safe-dump-explicit-start Passed
Dumps a document with an explicit YAML start marker and verifies the document header is emitted.
PyYAML safe dump flow style Port / libyaml / usage-python3-yaml-safe-dump-flow-style Passed
Dumps a sequence with default_flow_style enabled in PyYAML and verifies the inline flow array is emitted.
PyYAML safe dump indent Port / libyaml / usage-python3-yaml-safe-dump-indent Passed
PyYAML safe dump multiline indent Port / libyaml / usage-python3-yaml-safe-dump-multiline-indent Passed
Dumps a nested mapping with indent=4 in PyYAML and verifies the nested key is emitted with the configured indentation.
PyYAML unicode dump Port / libyaml / usage-python3-yaml-safe-dump-unicode Passed
PyYAML safe dump width Port / libyaml / usage-python3-yaml-safe-dump-width Passed
Safely dumps YAML with a narrow width setting and verifies the emitted text still contains the expected sequence values.
PyYAML SafeLoader rejects !!python/object/apply in load_all Port / libyaml / usage-python3-yaml-safe-load-all-rejects-python-apply-batch13 Passed
Feeds a multi-document stream containing a !!python/object/apply tag into yaml.load_all with SafeLoader and verifies a ConstructorError is raised before any unsafe object is constructed.
PyYAML safe load all three docs Port / libyaml / usage-python3-yaml-safe-load-all-three-docs Passed
Loads a stream of three YAML documents with safe_load_all and verifies each document scalar appears in stream order.
PyYAML safe_load_all Port / libyaml / usage-python3-yaml-safe-load-all Passed
PyYAML SafeLoader on |+ block scalar keeps trailing newlines Port / libyaml / usage-python3-yaml-safe-load-block-keep-chomp-batch16 Passed
Loads a literal block scalar with the keep chomping indicator (|+) through yaml.safe_load and verifies all trailing newlines after the content are preserved verbatim.
PyYAML SafeLoader on |- strips trailing newlines Port / libyaml / usage-python3-yaml-safe-load-block-strip-chomp-batch16 Passed
Loads a literal block scalar with the strip chomping indicator (|-) through yaml.safe_load and verifies all trailing newlines are removed from the resulting string while interior newlines are preserved.
PyYAML safe load bool list Port / libyaml / usage-python3-yaml-safe-load-bool-list Passed
PyYAML safe load float inf Port / libyaml / usage-python3-yaml-safe-load-float-inf Passed
PyYAML safe load flow mapping Port / libyaml / usage-python3-yaml-safe-load-flow-mapping Passed
PyYAML SafeLoader on >+ folded keep preserves trailing newlines Port / libyaml / usage-python3-yaml-safe-load-folded-keep-chomp-batch16 Passed
Loads a folded block scalar with the keep chomping indicator (>+) through yaml.safe_load and verifies that interior newlines are folded into spaces while every trailing newline is preserved verbatim.
PyYAML safe load folded scalar Port / libyaml / usage-python3-yaml-safe-load-folded-scalar Passed
Loads a folded block scalar with PyYAML and verifies line folding into a single space-separated string.
PyYAML safe load hex int Port / libyaml / usage-python3-yaml-safe-load-hex-int Passed
PyYAML safe load integer list Port / libyaml / usage-python3-yaml-safe-load-int-list Passed
PyYAML safe load literal scalar Port / libyaml / usage-python3-yaml-safe-load-literal-scalar Passed
Loads a literal block scalar with PyYAML and verifies that newline characters remain in the resulting string.
PyYAML safe load negative float Port / libyaml / usage-python3-yaml-safe-load-negative-float Passed
PyYAML safe load nested list Port / libyaml / usage-python3-yaml-safe-load-nested-list Passed
PyYAML safe load nested map Port / libyaml / usage-python3-yaml-safe-load-nested-map Passed
PyYAML safe load nested sequence Port / libyaml / usage-python3-yaml-safe-load-nested-sequence Passed
PyYAML safe load no bool Port / libyaml / usage-python3-yaml-safe-load-no-bool Passed
PyYAML safe load null list Port / libyaml / usage-python3-yaml-safe-load-null-list Passed
PyYAML safe_load on tilde null shorthand Port / libyaml / usage-python3-yaml-safe-load-null-tilde-batch14 Passed
Loads each of the canonical null spellings (~, null, Null, NULL, empty) through yaml.safe_load and verifies they all resolve to Python None while a quoted "~" remains a string.
PyYAML safe load octal int Port / libyaml / usage-python3-yaml-safe-load-octal-int Passed
PyYAML safe load ordered keys Port / libyaml / usage-python3-yaml-safe-load-ordered-keys Passed
PyYAML safe_load quoted vs unquoted yes/no Port / libyaml / usage-python3-yaml-safe-load-quoted-yes-string-batch14 Passed
Loads a mapping where yes, no, on, off appear both unquoted and quoted and verifies that PyYAML's bundled YAML 1.1-style bool resolver still coerces unquoted yes/no/on/off to Python bools while quoted forms are forced to strings. Confirms quoting is the only safe way to keep these tokens as strings under safe_load on Ubuntu 24.04.
PyYAML safe load set Port / libyaml / usage-python3-yaml-safe-load-set Passed
PyYAML safe load yes bool Port / libyaml / usage-python3-yaml-safe-load-yes-bool Passed
PyYAML safe load Port / libyaml / usage-python3-yaml-safe-load Passed
PyYAML list round trip Port / libyaml / usage-python3-yaml-safe-roundtrip-list Passed
PyYAML SafeDumper add_representer Port / libyaml / usage-python3-yaml-safedumper-add-representer-batch12 Passed
Registers a custom SafeDumper representer for a str subclass and verifies the emitted output uses the custom tag.
PyYAML SafeLoader honors explicit !!str tag to force string Port / libyaml / usage-python3-yaml-safeloader-explicit-str-tag-batch15 Passed
Loads scalars whose plain form would normally resolve to int or bool ("42", "true") but that are tagged with the explicit core schema tag !!str, and verifies SafeLoader yields a Python str whose value is the unparsed digit/word, while an untagged sibling resolves to its native int/bool.
PyYAML scan anchor token Port / libyaml / usage-python3-yaml-scan-anchor-token Passed
PyYAML scan emits a ScalarToken for a literal block scalar value Port / libyaml / usage-python3-yaml-scan-block-scalar-token-batch15 Passed
Feeds a mapping whose value is a literal-block scalar (introduced by '|') to yaml.scan and verifies a yaml.tokens.ScalarToken is emitted whose value carries the multi-line literal body verbatim, alongside the framing BlockMapping and Key/Value tokens.
PyYAML scan tokens for flow sequence [1,2,3] Port / libyaml / usage-python3-yaml-scan-flow-sequence-tokens-batch13 Passed
Scans the flow sequence "[1,2,3]" with yaml.scan and verifies FlowSequenceStart/End tokens, FlowEntry separators, and three scalar tokens with the expected values.
PyYAML scan key value tokens Port / libyaml / usage-python3-yaml-scan-key-value-tokens-batch12 Passed
Scans a block mapping with PyYAML and verifies BlockMappingStartToken, KeyToken, ValueToken, and ScalarToken values appear in the token stream.
PyYAML yaml.scan emits the expected count of BlockMappingStartTokens Port / libyaml / usage-python3-yaml-scan-mapping-start-token-count-batch16 Passed
Scans a YAML document containing exactly three nested block mappings with yaml.scan and verifies the token stream contains exactly three BlockMappingStartToken instances and at least one StreamStartToken / StreamEndToken pair.
PyYAML scan scalar count Port / libyaml / usage-python3-yaml-scan-scalar-count Passed
PyYAML scan stream tokens Port / libyaml / usage-python3-yaml-scan-stream-tokens-batch11 Passed
PyYAML scan token types Port / libyaml / usage-python3-yaml-scan-token-types Passed
Scans YAML into low-level tokens with PyYAML and verifies the stream-start and scalar token classes are produced.
PyYAML token scanner Port / libyaml / usage-python3-yaml-scan-tokens Passed
PyYAML serialize_all over multiple Node trees Port / libyaml / usage-python3-yaml-serialize-all-multiple-nodes-batch14 Passed
Builds three Node trees by hand and emits them as a single YAML stream with yaml.serialize_all, then verifies the stream contains three explicit document markers and round-trips through yaml.safe_load_all.
PyYAML serialize a constructed Node tree Port / libyaml / usage-python3-yaml-serialize-node-batch13 Passed
Builds a MappingNode/ScalarNode tree by hand and serializes it with yaml.serialize, verifying the emitted YAML round-trips through safe_load.
PyYAML custom !myset representer round-trips a Python set via SafeDumper / SafeLoader Port / libyaml / usage-python3-yaml-set-representer-batch18 Passed
Registers a custom representer on a SafeDumper subclass that emits Python sets as a sorted YAML sequence under a "!myset" tag, plus a paired constructor on a SafeLoader subclass that rebuilds a Python set from the sequence. Verifies the dumped text contains the !myset tag and a deterministic sorted ordering, and that loading reproduces a set with the original membership.
PyYAML sorted dump Port / libyaml / usage-python3-yaml-sorted-dump Passed
PyYAML type preservation for ints floats dates and timestamps Port / libyaml / usage-python3-yaml-type-preservation-jq Passed
Loads a YAML document with int, float, bool, date, and datetime scalars via CSafeLoader and verifies Python types and exact values, plus a jq sanity check on the JSON projection.
PyYAML round-trips uuid.UUID via custom !uuid representer and constructor Port / libyaml / usage-python3-yaml-uuid-roundtrip-batch17 Passed
Registers SafeDumper.add_representer and SafeLoader.add_constructor for the !uuid tag against uuid.UUID, dumps and reloads a fixed UUID4 value, and verifies the loaded object is a uuid.UUID with the original hex.
PyYAML YAMLError catches scanner syntax error Port / libyaml / usage-python3-yaml-yamlerror-syntax-catch-batch12 Passed
Feeds malformed flow content to yaml.safe_load and verifies the raised exception is caught as yaml.YAMLError with a ScannerError subtype.
CVE-2014-9130 libyaml regression Port / libyaml / cve-2014-9130 Passed
Asserts that libyaml reports a normal parse error (not an assertion abort) on the wrapped-scalar simple-key sequence that triggered the scanner.c assertion failure.