pytest-fixture-typecheck
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.
Metadata
Release files for pytest-fixture-typecheck 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-fixture-typecheck-0.1.0.tar.gz | 1.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_fixture_typecheck-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.6 kB
Release files / pytest-fixture-typecheck-0.1.0.tar.gz
| Download URL | pytest-fixture-typecheck-0.1.0.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b0d36c3555c7599238da59d95309580b113d1e74f432baf3bdb433c7fdef49a
|
|
BLAKE2b-256 checksum How to use checksums |
8391dd662f5079cc03e8fba6c26781967bb299a60694da35e059e215c3da946e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / pytest_fixture_typecheck-0.1.0-py3-none-any.whl
| Download URL | pytest_fixture_typecheck-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb09c8798935e26047547f6a43b13fd64658a086e8d3c1bffa46a6d7d7796f3b
|
|
BLAKE2b-256 checksum How to use checksums |
89ec7f2231d8b19a82a5df2e1018331951d4fc5bd44b12d6cfb5b90a46627206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|