Skip to main content

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.1.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file pytest-anything-0.1.1.tar.gz.

File metadata

  • Download URL: pytest-anything-0.1.1.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for pytest-anything-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ecd394953ebe1c9ac4af70a3c5625ec5b5cd2b4683b604c408e406533c311d7
MD5 eb2b65b5fe244f343bce85cf9f0bd790
BLAKE2b-256 8c5ce2db537fa0b54e691d54d441910a13df5c967ccddf5783e3997a2f05cae3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page