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,
[],
{},
(),
object,
object(),
type,
type(None),
None,
],
)
def test_anything(obj, Anything):
assert obj == Anything
@pytest.mark.parametrize(
"obj",
[
"string",
123,
123.1,
True,
False,
[],
{},
(),
object,
object(),
type,
type(None),
],
)
def test_something(obj, Something):
assert obj == Something
def test_nothing(Something):
assert None != Something
def test_something_special(Something):
assert object() == Something(lambda x: isinstance(x, object))
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.4.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for pytest_anything-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 357f86d5655bc300ef3d816a8549ab31e01420b07bdf16142753284329f4870f |
|
MD5 | 573b246a67da440c785acbe25c734f98 |
|
BLAKE2b-256 | 06c8d54541d5a3ec93634ad625a19b67e072ccff6fd5eee5a14ce17f5a3d85b0 |