Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beartype/pytest-beartype
A pytest plugin to automatically run `beartype` on your test cases.
https://github.com/beartype/pytest-beartype
pytest python3 runtime-typechecking
Last synced: 4 days ago
JSON representation
A pytest plugin to automatically run `beartype` on your test cases.
- Host: GitHub
- URL: https://github.com/beartype/pytest-beartype
- Owner: beartype
- License: mit
- Created: 2023-12-15T10:32:27.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T19:24:29.000Z (3 months ago)
- Last Synced: 2024-10-29T09:11:59.721Z (18 days ago)
- Topics: pytest, python3, runtime-typechecking
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pytest-beartype
Pytest plugin to run your tests with beartype checking enabled.
## Installation
```bash
pip install pytest_beartype
```## Usage
```bash
pytest --beartype-packages='your_package_name,other_package_name'
```This will ensure that any type annotations in those packages are checked at
runtime, while your tests are running.## Local Development / Testing
- Create and activate a virtual environment
- Run `pip install -r requirements-dev.txt` to do an editable install
- Run `pytest` to run tests## Type Checking
Run `mypy .`
## Create and upload a package to PyPI
Make sure to bump the version in `setup.cfg`.
Then run the following commands:
```bash
rm -rf build dist
python setup.py sdist bdist_wheel
```Then upload it to PyPI using [twine](https://twine.readthedocs.io/en/latest/#installation):
```bash
twine upload dist/*
```