One function that makes the string matchable
Project description
full_match
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32cfbeba50ef0f1625eba63869e59a0971c8570f2a30b0f38d7e1939fb945f2e
|
|
| MD5 |
3b3c49fd55d8cf36c9fc053532d10737
|
|
| BLAKE2b-256 |
e8a5a7804626e4a2d9fb04a3a98264c329c1ea88f12324b724b303183ed4534f
|
Provenance
The following attestation bundles were made for full_match-0.0.3.tar.gz:
Publisher:
release.yml on pomponchik/full_match
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
full_match-0.0.3.tar.gz -
Subject digest:
32cfbeba50ef0f1625eba63869e59a0971c8570f2a30b0f38d7e1939fb945f2e - Sigstore transparency entry: 595556724
- Sigstore integration time:
-
Permalink:
pomponchik/full_match@05043698785d8819f9855a863835153e2940cc9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pomponchik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@05043698785d8819f9855a863835153e2940cc9c -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7ab0187d7ec8b2839f0359d413267599fe5aa7c2c8a980c4072842d0d708e94
|
|
| MD5 |
7d7c7a83aa2ea9fd4e055cf9faf360d1
|
|
| BLAKE2b-256 |
dbce55b6b3c0acaca3399c56e55273515089f904a5fe598e214e7bf56fe61f70
|
Provenance
The following attestation bundles were made for full_match-0.0.3-py3-none-any.whl:
Publisher:
release.yml on pomponchik/full_match
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
full_match-0.0.3-py3-none-any.whl -
Subject digest:
d7ab0187d7ec8b2839f0359d413267599fe5aa7c2c8a980c4072842d0d708e94 - Sigstore transparency entry: 595556770
- Sigstore integration time:
-
Permalink:
pomponchik/full_match@05043698785d8819f9855a863835153e2940cc9c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pomponchik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@05043698785d8819f9855a863835153e2940cc9c -
Trigger Event:
push
-
Statement type: