/assertpy-stubs

Mypy|Pyright plugin and stubs for assertpy

Primary LanguagePythonMIT LicenseMIT

PyPI version Code on Github Code style: black GitHub last commit

assertpy-stubs

Add types for assertpy for mypy or pyright.

Installation

$ pip install assertpy-stubs

Usage

Mypy or pyright will automatically use the type annotations in this package, once it is installed. You just need to annotate your code:

from assertpy import assert_that


def test_something():
    assert_that(1 + 2).is_equal_to(3)
    assert_that("foobar").is_length(6).starts_with("foo").ends_with("bar")
    assert_that(["a", "b", "c"]).contains("a").does_not_contain("x")

For general hints how to use type annotations, please read Type Annotations in Python 3.8