Pytest fixtures to assert anything and something
Project description
If you ever had to ignore a certain part of an assertion, you would end up with this.
import pytest
@pytest.mark.parametrize("obj", ["string", 123, 123.1, True, False, None, object()])
def test_anything(obj, Anything):
assert obj == Anything
@pytest.mark.parametrize("obj", ["string", 123, 123.1, True, False, object()])
def test_something(obj, Something):
assert obj == Something
def test_nothing(Something):
obj = None
assert obj != Something
def test_anything_repr(Anything):
assert repr(Anything) == "Anything"
def test_something_repr(Something):
assert repr(Something) == "Something"
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
pytest-anything-0.1.2.tar.gz
(2.0 kB
view details)
Built Distribution
File details
Details for the file pytest-anything-0.1.2.tar.gz
.
File metadata
- Download URL: pytest-anything-0.1.2.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e05f024720ca64101fdb3b1c00015d961b1a47f05f71157a6fb2fdd5dfcdf581 |
|
MD5 | 0620470eb5cb9fca71e87e44ea5873cb |
|
BLAKE2b-256 | e3d11d906304f86314cbc259e2d761163eb6c64ff39a65003fb641dfdd39ed26 |
File details
Details for the file pytest_anything-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pytest_anything-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 852e5e8b49f29e28c58f8a50f72c6c6e743d44a3a648b1492eb8917b1cec053e |
|
MD5 | c05b1f821b9f0c6329267e6cf570a9e3 |
|
BLAKE2b-256 | 0fd8a53b6ca65cc38ef097603e66c6c3e531ffd9d5d2611a2233e151d220e8bd |