Anything and Something fixtures for pytest
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))
Release files for pytest-anything 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-anything-0.1.4.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_anything-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / pytest-anything-0.1.4.tar.gz
| Download URL | pytest-anything-0.1.4.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf962202c02bc25dda527654ecb0c4fe938c76a09b8e28a860a38ca09bb8f6fa
|
|
BLAKE2b-256 checksum How to use checksums |
0242d0e1b46582a25ac203e05e2dd203ec9d1af42fa917905113f3a6e26146c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
|
Release files / pytest_anything-0.1.4-py3-none-any.whl
| Download URL | pytest_anything-0.1.4-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
357f86d5655bc300ef3d816a8549ab31e01420b07bdf16142753284329f4870f
|
|
BLAKE2b-256 checksum How to use checksums |
06c8d54541d5a3ec93634ad625a19b67e072ccff6fd5eee5a14ce17f5a3d85b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
|