Metadata-Version: 2.1
Name: typest
Version: 0.1.1
Summary: A framework for testing type expectations
License: MIT
Author: Jonathan Scholbach
Author-email: j.scholbach@posteo.de
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: comment-parser (>=1.2.4,<2.0.0)
Requires-Dist: mypy (>=0.991,<0.992)
Description-Content-Type: text/markdown

# typest

An experimental framework to test your library against type checkers, allowing
to formulate type expectations and expected typechecker errors. Its purpose is
the same as the one of
[pytest-mypy-plugins](https://pypi.org/project/pytest-mypy-plugins/). While
`pytest-mypy-plugins` requires `.yaml` files for specifying the tests, `typest`
test cases are python files, expectations are formulated in comments:


```Python
from mylibrary import some_function

result = some_function()

reveal_type(result)  # expect-type: int
```


Besides expressing type expectations, you can also specify to expect an error
from the typechecker:

```Python
string: str = "not a number"
number: int = string  # expect-error
```


You can also specify which error you expect:

```Python
string: str = "not a number"
number: int = string  # expect-error: Incompatible types in assignment (expression has type "int", variable has type "str")  [assignment]
```

