A pytest plugin to assert type annotations at runtime.
Project description
pytest-fixture-typecheck is a pytest plugin that inserts runtime assertions that your fixture usages are properly typed.
Problem
Pytest fixtures are magic that mypy does not understand. This typechecks just fine:
@pytest.fixture def myint(): return 42 def test_basic(myint: str): assert myint == 42
This test passes but the type annotation is wrong.
With this pytest plugin it will pass typechecking all the same, but your test will fail at least.
If your tests do not have type annotations, this plugin does nothing. Use mypy to enforce that everything has type annotations.
License
Licensed under public domain.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-fixture-typecheck-0.1.0.tar.gz
.
File metadata
- Download URL: pytest-fixture-typecheck-0.1.0.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0d36c3555c7599238da59d95309580b113d1e74f432baf3bdb433c7fdef49a |
|
MD5 | 97c82dd51f8d66d2647c4d6fb94a6923 |
|
BLAKE2b-256 | 8391dd662f5079cc03e8fba6c26781967bb299a60694da35e059e215c3da946e |
File details
Details for the file pytest_fixture_typecheck-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_fixture_typecheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb09c8798935e26047547f6a43b13fd64658a086e8d3c1bffa46a6d7d7796f3b |
|
MD5 | 2879daaa910d481b6f85ff81ef82d54a |
|
BLAKE2b-256 | 89ec7f2231d8b19a82a5df2e1018331951d4fc5bd44b12d6cfb5b90a46627206 |