pytest-mpiexec


Namepytest-mpiexec JSON
Version 0.0.1a1 PyPI version JSON
download
home_page
Summarypytest plugin for running individual tests with mpiexec
upload_time2023-04-13 12:23:02
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 Min RK 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 mpi pytest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-mpixec

pytest plugin for running individual tests with mpiexec

A test marked with `mark.mpiexec` will be run in a separate instance with mpiexec,
instead of in the current process.

The subprocess test will be run with pytest,
so fixtures and everything should still work!

The number of processes can be parametrized if you parametrize an argument called `mpiexec_n`.

## Try it out

```
pip install pytest-mpiexec
```

And write tests that use mpiexec:

```python
from mpi4py import MPI

@pytest.mark.mpiexec(n=2)
def test_my_mpi_code(fixtures):

@pytest.mark.mpiexec
@pytest.mark.parametrize("mpiexec_n", [1, 2, 3])
def test_my_mpi_code(mpiexec_n):
    assert MPI.COMM_WORLD.size == mpiexec_n

```

## Caveats

If you use module or session-scoped fixtures, another instance will be running,
so these can't conflict with other pytest runs (e.g. conflicting on ports, files, etc.)

## Prior art

- pytest-mpi (helpers for tests run inside mpi - compatible with this package!)
- pytest-easyMPI (similar goal to this one, but takes a different approach)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pytest-mpiexec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "mpi,pytest",
    "author": "",
    "author_email": "Min RK <benjaminrk@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9f/38/52f97f2a66632b1bbe1547ff9ba8121c95c3a43f47bbc59d37efa6e7d430/pytest_mpiexec-0.0.1a1.tar.gz",
    "platform": null,
    "description": "# pytest-mpixec\n\npytest plugin for running individual tests with mpiexec\n\nA test marked with `mark.mpiexec` will be run in a separate instance with mpiexec,\ninstead of in the current process.\n\nThe subprocess test will be run with pytest,\nso fixtures and everything should still work!\n\nThe number of processes can be parametrized if you parametrize an argument called `mpiexec_n`.\n\n## Try it out\n\n```\npip install pytest-mpiexec\n```\n\nAnd write tests that use mpiexec:\n\n```python\nfrom mpi4py import MPI\n\n@pytest.mark.mpiexec(n=2)\ndef test_my_mpi_code(fixtures):\n\n@pytest.mark.mpiexec\n@pytest.mark.parametrize(\"mpiexec_n\", [1, 2, 3])\ndef test_my_mpi_code(mpiexec_n):\n    assert MPI.COMM_WORLD.size == mpiexec_n\n\n```\n\n## Caveats\n\nIf you use module or session-scoped fixtures, another instance will be running,\nso these can't conflict with other pytest runs (e.g. conflicting on ports, files, etc.)\n\n## Prior art\n\n- pytest-mpi (helpers for tests run inside mpi - compatible with this package!)\n- pytest-easyMPI (similar goal to this one, but takes a different approach)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Min RK  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": "pytest plugin for running individual tests with mpiexec",
    "version": "0.0.1a1",
    "split_keywords": [
        "mpi",
        "pytest"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a21f3babd2648fb59e0bb0fcf8f57b41891bcabbe34e111811f0aebed2cd7a01",
                "md5": "03c400a25789ea3bebc88f480af82b9a",
                "sha256": "e0eb0ab72a102a498e6d08dabd1abf5898626219d2c141f883a52f1be540c530"
            },
            "downloads": -1,
            "filename": "pytest_mpiexec-0.0.1a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03c400a25789ea3bebc88f480af82b9a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5326,
            "upload_time": "2023-04-13T12:23:00",
            "upload_time_iso_8601": "2023-04-13T12:23:00.781943Z",
            "url": "https://files.pythonhosted.org/packages/a2/1f/3babd2648fb59e0bb0fcf8f57b41891bcabbe34e111811f0aebed2cd7a01/pytest_mpiexec-0.0.1a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f3852f97f2a66632b1bbe1547ff9ba8121c95c3a43f47bbc59d37efa6e7d430",
                "md5": "36385f2c1d87758b7b087a3998d63f8b",
                "sha256": "bc71af52d503249995fc6e8f74a3f3361a2af4574aae71665b257610e1484c03"
            },
            "downloads": -1,
            "filename": "pytest_mpiexec-0.0.1a1.tar.gz",
            "has_sig": false,
            "md5_digest": "36385f2c1d87758b7b087a3998d63f8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7038,
            "upload_time": "2023-04-13T12:23:02",
            "upload_time_iso_8601": "2023-04-13T12:23:02.505830Z",
            "url": "https://files.pythonhosted.org/packages/9f/38/52f97f2a66632b1bbe1547ff9ba8121c95c3a43f47bbc59d37efa6e7d430/pytest_mpiexec-0.0.1a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-13 12:23:02",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pytest-mpiexec"
}
        
Elapsed time: 0.06475s