Skip to main content

pipeline.compare()

Every difference between two JSON values, by path.

Usage

Source

pipeline.compare(
    recorded,
    found,
    *,
    rtol=RTOL,
    atol=ATOL,
    path="",
)

Two numbers of which one is a float match when |a - b| <= max(rtol * max(|a|, |b|), atol) (math.isclose); two integers, and everything that is not a number, must be equal and of the same type (True is not 1). Dictionaries are compared key by key, lists position by position; a missing key, an extra key or another length is a difference.