Name | pytest-cmake JSON |
Version |
0.13.0
JSON |
| download |
home_page | None |
Summary | Provide CMake module for Pytest |
upload_time | 2025-02-17 00:41:22 |
maintainer | None |
docs_url | None |
author | None |
requires_python | !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,<4,>=2.7 |
license | MIT License
Copyright (c) 2022 Jeremy Retailleau
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 |
cmake
development
pytest
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Pytest CMake
[](https://pypi.python.org/pypi/pytest-cmake)
[](https://cmake.org)
[](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml)
[](https://opensource.org/licenses/MIT)
This project provides convenient ways to use [Pytest](https://docs.pytest.org/)
within a [CMake](https://cmake.org/) project. The package can be discovered from a specific range of
versions on Linux, macOS or Windows using the
[find_package](https://cmake.org/cmake/help/latest/command/find_package.html)
function:
```cmake
find_package(Pytest 8.2.1 REQUIRED)
```
A ``pytest_discover_tests`` function is provided to simplify automatic
testing for C++ projects with Python bindings. It can create CTest tests
for each Python test collected within a controlled environment:
```cmake
pytest_discover_tests(
PythonTest
LIBRARY_PATH_PREPEND
$<TARGET_FILE_DIR:MyLibrary>
PYTHON_PATH_PREPEND
$<TARGET_FILE_DIR:MyLibrary>
TRIM_FROM_NAME "^test_"
DEPENDS MyLibrary
)
```
Running the tests will display the status for each test collected as follows:
```console
Start 1: PythonTest.greet_world
1/4 Test #1: PythonTest.greet_world ........... Passed 0.47 sec
Start 2: PythonTest.greet_john
2/4 Test #2: PythonTest.greet_john ............ Passed 0.47 sec
Start 3: PythonTest.greet_julia
3/4 Test #3: PythonTest.greet_julia ........... Passed 0.47 sec
Start 4: PythonTest.greet_michael
4/4 Test #4: PythonTest.greet_michael ......... Passed 0.54 sec
```
## Documentation
Full documentation, including installation and setup guides, can be found at
https://python-cmake.github.io/pytest-cmake/
Raw data
{
"_id": null,
"home_page": null,
"name": "pytest-cmake",
"maintainer": null,
"docs_url": null,
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,<4,>=2.7",
"maintainer_email": null,
"keywords": "cmake, development, pytest",
"author": null,
"author_email": "Jeremy Retailleau <jeremy.retailleau@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/79/f0/ee0fcf1fb5b69992c8f7dd6a2f341b9a4c221678667d83ca731ac87d40e9/pytest_cmake-0.13.0.tar.gz",
"platform": null,
"description": "# Pytest CMake\n\n[](https://pypi.python.org/pypi/pytest-cmake)\n[](https://cmake.org)\n[](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml)\n[](https://opensource.org/licenses/MIT)\n\nThis project provides convenient ways to use [Pytest](https://docs.pytest.org/)\nwithin a [CMake](https://cmake.org/) project. The package can be discovered from a specific range of\nversions on Linux, macOS or Windows using the\n[find_package](https://cmake.org/cmake/help/latest/command/find_package.html)\nfunction:\n\n```cmake\nfind_package(Pytest 8.2.1 REQUIRED)\n```\n\nA ``pytest_discover_tests`` function is provided to simplify automatic\ntesting for C++ projects with Python bindings. It can create CTest tests\nfor each Python test collected within a controlled environment:\n\n```cmake\npytest_discover_tests(\n PythonTest\n LIBRARY_PATH_PREPEND\n $<TARGET_FILE_DIR:MyLibrary>\n PYTHON_PATH_PREPEND\n $<TARGET_FILE_DIR:MyLibrary>\n TRIM_FROM_NAME \"^test_\"\n DEPENDS MyLibrary\n)\n```\n\nRunning the tests will display the status for each test collected as follows:\n\n```console\n Start 1: PythonTest.greet_world\n1/4 Test #1: PythonTest.greet_world ........... Passed 0.47 sec\n Start 2: PythonTest.greet_john\n2/4 Test #2: PythonTest.greet_john ............ Passed 0.47 sec\n Start 3: PythonTest.greet_julia\n3/4 Test #3: PythonTest.greet_julia ........... Passed 0.47 sec\n Start 4: PythonTest.greet_michael\n4/4 Test #4: PythonTest.greet_michael ......... Passed 0.54 sec\n```\n\n## Documentation\n\nFull documentation, including installation and setup guides, can be found at\nhttps://python-cmake.github.io/pytest-cmake/\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2022 Jeremy Retailleau\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Provide CMake module for Pytest",
"version": "0.13.0",
"project_urls": {
"Changelog": "https://python-cmake.github.io/pytest-cmake/release/release_notes.html",
"Documentation": "https://python-cmake.github.io/pytest-cmake",
"Issues": "https://github.com/python-cmake/pytest-cmake/issues",
"Repository": "https://github.com/python-cmake/pytest-cmake"
},
"split_keywords": [
"cmake",
" development",
" pytest"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "79f0ee0fcf1fb5b69992c8f7dd6a2f341b9a4c221678667d83ca731ac87d40e9",
"md5": "358b98ca8e87d3abe0d68da3fd4370aa",
"sha256": "9751fab8fe7baa08cd0bde2bc30a715644714771bb1eab145027471cc0db2c15"
},
"downloads": -1,
"filename": "pytest_cmake-0.13.0.tar.gz",
"has_sig": false,
"md5_digest": "358b98ca8e87d3abe0d68da3fd4370aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,<4,>=2.7",
"size": 7523,
"upload_time": "2025-02-17T00:41:22",
"upload_time_iso_8601": "2025-02-17T00:41:22.955934Z",
"url": "https://files.pythonhosted.org/packages/79/f0/ee0fcf1fb5b69992c8f7dd6a2f341b9a4c221678667d83ca731ac87d40e9/pytest_cmake-0.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 00:41:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "python-cmake",
"github_project": "pytest-cmake",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytest-cmake"
}