Skip to main content

hamcrest-proto

Hamcrest matchers for Protocol Buffers in Python.

This is forked from proto-matcher which was no longer receiving updates and which was itself based on MessageDifferencer and EqualsProto googletest matcher.

API

This packages provides the following proto-related matchers:

equals_proto

equals_proto(expected: Message | str)

Test the argument equals the given protobuf message.

approximately

approximately(matcher: Matcher[Message],
              float_margin: float | None = None,
              float_fraction: float | None = None)

Test the argument equals the given protobuf message, while comparing any float field using approximation.

ignoring_field_paths

ignoring_field_paths(field_paths: set[tuple[str, ...]],
                     matcher: Matcher[Message])

Test the argument equals the given protobuf message, while ignoring those fields specified in the field paths.

ignoring_repeated_field_ordering

ignoring_repeated_field_ordering(matcher: Matcher[Message])

Test the argument equals the given protobuf message, ignoring the ordering of any repeated field.

partially

partially(matcher: Matcher[Message])

Test the argument partially equals the given protobuf message, i.e. if a field is in the argument but not in the expected message, it's ignored in the comparison.

Development

This project uses uv for dependency management and just as a command runner.

just install   # create the venv and generate the test protos
just           # format, run all checks (ruff, pyright, deptry), and test

See the Justfile for individual recipes.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hamcrest_proto-0.0.8.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hamcrest_proto-0.0.8-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file hamcrest_proto-0.0.8.tar.gz.

File metadata

  • Download URL: hamcrest_proto-0.0.8.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hamcrest_proto-0.0.8.tar.gz
Algorithm Hash digest
SHA256 522f3424c72390bc6c8e3daab807a0afb4c73f7cbecc78b6600e20638543cab4
MD5 f8d437c8e552aa51c60414499c82278d
BLAKE2b-256 769023d1da38ac157fcca2515ef15be9d776bb64120dfe8a4009242fb3440aec

See more details on using hashes here.

Provenance

The following attestation bundles were made for hamcrest_proto-0.0.8.tar.gz:

Publisher: publish.yml on mdepinet/hamcrest-proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hamcrest_proto-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: hamcrest_proto-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hamcrest_proto-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0ca262eef8371f90b2b3b35c3dc30913d9989bdcbd561c7fa86bda33a5d2f7e4
MD5 5d5bdea3a087aac8eaa19aeaca7414d8
BLAKE2b-256 96e94f60f14a87e04f0f2330baa07321a8c9102f69716a91d2eb0b9704e474a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for hamcrest_proto-0.0.8-py3-none-any.whl:

Publisher: publish.yml on mdepinet/hamcrest-proto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page