New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pytest-anything

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pytest-anything

Pytest fixtures to assert anything and something

  • 0.1.4
  • PyPI
  • Socket score

Maintainers
1

Anything and Something fixtures for pytest

If you ever had to ignore a certain part of an assertion, you would end up with this.

.. code-block:: python

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))

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc