Name | pytest-typeguard JSON |
Version |
2024.8.21.2
JSON |
| download |
home_page | None |
Summary | Run-time type checking for pytest test arguments |
upload_time | 2024-08-21 19:16:19 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT License Copyright (c) 2019 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
pytest
typeguard
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
|Build Status| |codecov| |PyPI| |Documentation Status|
Pytest Typeguard
================
Check that arguments to ``pytest`` tests are correctly typed.
These might come from fixtures, or parameters passed to the test.
Installation
------------
.. code:: sh
pip install pytest-typeguard
This is tested on Python 3.12+.
Use case
--------
``pytest-typeguard`` will catch errors like the following:
.. code:: python
import io
@pytest.mark.parametrize(
"number',
[
1,
2.0, # This is the wrong type for the type hint.
],
)
def test_example(number: int) -> None:
...
.. |Build Status| image:: https://github.com/adamtheturtle/pytest-typeguard/workflows/CI/badge.svg
:target: https://github.com/adamtheturtle/pytest-typeguard/actions
.. |codecov| image:: https://codecov.io/gh/adamtheturtle/pytest-typeguard/branch/main/graph/badge.svg
:target: https://codecov.io/gh/adamtheturtle/pytest-typeguard
.. |Documentation Status| image:: https://readthedocs.org/projects/pytest-typeguard/badge/?version=latest
:target: https://pytest-typeguard.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. |PyPI| image:: https://badge.fury.io/py/pytest-typeguard.svg
:target: https://badge.fury.io/py/pytest-typeguard
Raw data
{
"_id": null,
"home_page": null,
"name": "pytest-typeguard",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "pytest, typeguard",
"author": null,
"author_email": "Adam Dangoor <adamdangoor@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b8/e6/9e0d1b20231d42ac2afc157d4d13d90213a64647a661c59c8ba4f67e3c87/pytest_typeguard-2024.8.21.2.tar.gz",
"platform": null,
"description": "|Build Status| |codecov| |PyPI| |Documentation Status|\n\nPytest Typeguard\n================\n\nCheck that arguments to ``pytest`` tests are correctly typed.\nThese might come from fixtures, or parameters passed to the test.\n\nInstallation\n------------\n\n.. code:: sh\n\n pip install pytest-typeguard\n\nThis is tested on Python 3.12+.\n\nUse case\n--------\n\n``pytest-typeguard`` will catch errors like the following:\n\n.. code:: python\n\n import io\n\n @pytest.mark.parametrize(\n \"number',\n [\n 1,\n 2.0, # This is the wrong type for the type hint.\n ],\n )\n def test_example(number: int) -> None:\n ...\n\n.. |Build Status| image:: https://github.com/adamtheturtle/pytest-typeguard/workflows/CI/badge.svg\n :target: https://github.com/adamtheturtle/pytest-typeguard/actions\n.. |codecov| image:: https://codecov.io/gh/adamtheturtle/pytest-typeguard/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/adamtheturtle/pytest-typeguard\n.. |Documentation Status| image:: https://readthedocs.org/projects/pytest-typeguard/badge/?version=latest\n :target: https://pytest-typeguard.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. |PyPI| image:: https://badge.fury.io/py/pytest-typeguard.svg\n :target: https://badge.fury.io/py/pytest-typeguard\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2019 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Run-time type checking for pytest test arguments",
"version": "2024.8.21.2",
"project_urls": {
"Source": "https://github.com/adamtheturtle/pytest-typeguard"
},
"split_keywords": [
"pytest",
" typeguard"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7a3f0b3d8022f1855740bd8e4c1ed40e5cd0cb6ec0383b1b0d6ca2b25fde6335",
"md5": "31f6f26c03fedb929026f33d1ff7d44d",
"sha256": "716960a3dd7b80736bd68bc17a7b693b6ff88b7d568bf812520aebe2bb3b4548"
},
"downloads": -1,
"filename": "pytest_typeguard-2024.8.21.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "31f6f26c03fedb929026f33d1ff7d44d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.12",
"size": 4974,
"upload_time": "2024-08-21T19:16:18",
"upload_time_iso_8601": "2024-08-21T19:16:18.247689Z",
"url": "https://files.pythonhosted.org/packages/7a/3f/0b3d8022f1855740bd8e4c1ed40e5cd0cb6ec0383b1b0d6ca2b25fde6335/pytest_typeguard-2024.8.21.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b8e69e0d1b20231d42ac2afc157d4d13d90213a64647a661c59c8ba4f67e3c87",
"md5": "e6782e5866324ca2e992d5ee8f793405",
"sha256": "bf1359cd4ce1a55cc8d55e9fd831a07e11f736c0272b36f1226f4ca71158f91e"
},
"downloads": -1,
"filename": "pytest_typeguard-2024.8.21.2.tar.gz",
"has_sig": false,
"md5_digest": "e6782e5866324ca2e992d5ee8f793405",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 14491,
"upload_time": "2024-08-21T19:16:19",
"upload_time_iso_8601": "2024-08-21T19:16:19.578509Z",
"url": "https://files.pythonhosted.org/packages/b8/e6/9e0d1b20231d42ac2afc157d4d13d90213a64647a661c59c8ba4f67e3c87/pytest_typeguard-2024.8.21.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 19:16:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adamtheturtle",
"github_project": "pytest-typeguard",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytest-typeguard"
}