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
Close
Hashes for pytest-fixture-typecheck-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0d36c3555c7599238da59d95309580b113d1e74f432baf3bdb433c7fdef49a |
|
MD5 | 97c82dd51f8d66d2647c4d6fb94a6923 |
|
BLAKE2b-256 | 8391dd662f5079cc03e8fba6c26781967bb299a60694da35e059e215c3da946e |
Close
Hashes for pytest_fixture_typecheck-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb09c8798935e26047547f6a43b13fd64658a086e8d3c1bffa46a6d7d7796f3b |
|
MD5 | 2879daaa910d481b6f85ff81ef82d54a |
|
BLAKE2b-256 | 89ec7f2231d8b19a82a5df2e1018331951d4fc5bd44b12d6cfb5b90a46627206 |