Skip to main content

One function that makes the string matchable

Project description

full_match

Downloads Downloads Coverage Status Lines of code Hits-of-Code Test-Package Python versions PyPI version Checked with mypy Ruff

When catching exceptions in Pytest, sometimes you need to check messages. Since the user sends a pattern for searching, and not a message for exact matching, sometimes similar, but not identical messages pass through the filter. This micro-library contains a function that makes Pytest check exception messages accurately.

It may also be useful to you if you use mutation testing tools such as mutmut.

Install it:

pip install full_match

And use:

import pytest
from full_match import match

def test_something():
  with pytest.raises(AssertionError, match='Regex pattern did not match.'):
    with pytest.raises(ValueError, match=match('Some message.')):
      raise ValueError('XXSome message.XX')

The message in the inner with block does not match the pattern exactly, so an AssertionError exception will occur in this example.

Project details


Download files

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

Source Distribution

full_match-0.0.3.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

full_match-0.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file full_match-0.0.3.tar.gz.

File metadata

  • Download URL: full_match-0.0.3.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for full_match-0.0.3.tar.gz
Algorithm Hash digest
SHA256 32cfbeba50ef0f1625eba63869e59a0971c8570f2a30b0f38d7e1939fb945f2e
MD5 3b3c49fd55d8cf36c9fc053532d10737
BLAKE2b-256 e8a5a7804626e4a2d9fb04a3a98264c329c1ea88f12324b724b303183ed4534f

See more details on using hashes here.

Provenance

The following attestation bundles were made for full_match-0.0.3.tar.gz:

Publisher: release.yml on pomponchik/full_match

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

File details

Details for the file full_match-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: full_match-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for full_match-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ab0187d7ec8b2839f0359d413267599fe5aa7c2c8a980c4072842d0d708e94
MD5 7d7c7a83aa2ea9fd4e055cf9faf360d1
BLAKE2b-256 dbce55b6b3c0acaca3399c56e55273515089f904a5fe598e214e7bf56fe61f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for full_match-0.0.3-py3-none-any.whl:

Publisher: release.yml on pomponchik/full_match

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 Pingdom Monitoring Sentry Error logging StatusPage Status page