**********
mpunittest
**********
|img1| |img2| |img3| |img4| |img5| |img6|
.. |img1| image:: https://img.shields.io/pypi/pyversions/mpunittest
:alt: pypi python version(s)
.. |img2| image:: https://img.shields.io/pypi/implementation/mpunittest
:alt: pypi implementation
.. |img3| image:: https://img.shields.io/pypi/status/mpunittest
:alt: pypi development status
.. |img4| image:: https://img.shields.io/pypi/v/mpunittest
:alt: pypi latest version
.. |img5| image:: https://img.shields.io/pypi/dm/mpunittest
:alt: pypi downloads per month
.. |img6| image:: https://img.shields.io/badge/tested%20on-macos%20%7C%20ubuntu%20%7C%20windows-blue
:alt: tested on which operating systems
| A Python library/application for running unittests in parallel and merging results.
Installation
============
To install the latest release from `PyPI <https://pypi.org/project/mpunittest/>`_,
simply run::
pip install mpunittest
Or to install the latest development version, run::
git clone https://github.com/maximilianpilz/mpunittest
python -m pip install .
Quick Start
===========
An example for running with 10 workers and generating an html file containing the results::
merging_runner = mpunittest.runner.MergingRunner(process_count=10)
merging_runner.discover_and_run(
start_dir=pathlib.Path('path_to_search_in').resolve(),
pattern="*.py",
html_result_assets=mpunittest.runner.HtmlResultAssets(
document_title='title of the html',
document_file_name='name_of_the_html_file',
result_path='unittest_results'
)
)
An example for running with 10 workers and without any files being generated::
merging_runner = mpunittest.runner.MergingRunner(process_count=10)
result = merging_runner.discover_and_run(
start_dir=pathlib.Path('path_to_search_in').resolve(),
pattern="*.py"
)
print(result)
An example for turning on logging::
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
handler.setLevel(logging.INFO)
mpunittest.logging.logger.addHandler(handler)
# run tests here
mpunittest.logging.logger.getChild('your.script').info('result: %s', result)
An example for running without writing additional python code::
python -m mpunittest.run /Users/yourname/dev/python_projects/yourproject/src/tests -p "test*.py" -da -c 4
To see the help for running without writing additional python code::
python -m mpunittest.run --help
Licensing
=========
Copyright (C) 2023 Maximilian Pilz
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Raw data
{
"_id": null,
"home_page": "",
"name": "mpunittest",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Maximilian Pilz <maximilian.pilz.git@gmail.com>",
"keywords": "multiprocessing,parallel,process,processes,runner,unittest,unittests",
"author": "Maximilian Pilz",
"author_email": "maximilian.pilz.git@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f8/2c/c379aa7be08e5550a7220a3fb1f1cd5c4d1bfdd556670252ade813da2d22/mpunittest-0.0.0a6.tar.gz",
"platform": null,
"description": "**********\nmpunittest\n**********\n\n|img1| |img2| |img3| |img4| |img5| |img6|\n\n.. |img1| image:: https://img.shields.io/pypi/pyversions/mpunittest\n :alt: pypi python version(s)\n\n.. |img2| image:: https://img.shields.io/pypi/implementation/mpunittest\n :alt: pypi implementation\n\n.. |img3| image:: https://img.shields.io/pypi/status/mpunittest\n :alt: pypi development status\n\n.. |img4| image:: https://img.shields.io/pypi/v/mpunittest\n :alt: pypi latest version\n\n.. |img5| image:: https://img.shields.io/pypi/dm/mpunittest\n :alt: pypi downloads per month\n\n.. |img6| image:: https://img.shields.io/badge/tested%20on-macos%20%7C%20ubuntu%20%7C%20windows-blue\n :alt: tested on which operating systems\n\n\n| A Python library/application for running unittests in parallel and merging results.\n\nInstallation\n============\n\nTo install the latest release from `PyPI <https://pypi.org/project/mpunittest/>`_,\nsimply run::\n\n pip install mpunittest\n\nOr to install the latest development version, run::\n\n git clone https://github.com/maximilianpilz/mpunittest\n python -m pip install .\n\nQuick Start\n===========\n\nAn example for running with 10 workers and generating an html file containing the results::\n\n merging_runner = mpunittest.runner.MergingRunner(process_count=10)\n\n merging_runner.discover_and_run(\n start_dir=pathlib.Path('path_to_search_in').resolve(),\n pattern=\"*.py\",\n html_result_assets=mpunittest.runner.HtmlResultAssets(\n document_title='title of the html',\n document_file_name='name_of_the_html_file',\n result_path='unittest_results'\n )\n )\n\nAn example for running with 10 workers and without any files being generated::\n\n merging_runner = mpunittest.runner.MergingRunner(process_count=10)\n\n result = merging_runner.discover_and_run(\n start_dir=pathlib.Path('path_to_search_in').resolve(),\n pattern=\"*.py\"\n )\n\n print(result)\n\nAn example for turning on logging::\n\n handler = logging.StreamHandler()\n formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n handler.setFormatter(formatter)\n handler.setLevel(logging.INFO)\n mpunittest.logging.logger.addHandler(handler)\n\n # run tests here\n\n mpunittest.logging.logger.getChild('your.script').info('result: %s', result)\n\nAn example for running without writing additional python code::\n\n python -m mpunittest.run /Users/yourname/dev/python_projects/yourproject/src/tests -p \"test*.py\" -da -c 4\n\nTo see the help for running without writing additional python code::\n\n python -m mpunittest.run --help\n\nLicensing\n=========\n\nCopyright (C) 2023 Maximilian Pilz\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; version 2.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.",
"bugtrack_url": null,
"license": "GPL-2.0-only",
"summary": "Multi core processing of unittests",
"version": "0.0.0a6",
"split_keywords": [
"multiprocessing",
"parallel",
"process",
"processes",
"runner",
"unittest",
"unittests"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8f320575fa54fe8804ba2d6455d4af64d2c46af4d4737efc8c166e13a95fd46c",
"md5": "21d8448b5642cb1b40fd3be5a8cc0ba5",
"sha256": "b386952b65c64555f0633dc5b467e79f654e1308dcf38ef3e924a752cb1f8cb6"
},
"downloads": -1,
"filename": "mpunittest-0.0.0a6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "21d8448b5642cb1b40fd3be5a8cc0ba5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 33160,
"upload_time": "2023-03-27T22:01:01",
"upload_time_iso_8601": "2023-03-27T22:01:01.991528Z",
"url": "https://files.pythonhosted.org/packages/8f/32/0575fa54fe8804ba2d6455d4af64d2c46af4d4737efc8c166e13a95fd46c/mpunittest-0.0.0a6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f82cc379aa7be08e5550a7220a3fb1f1cd5c4d1bfdd556670252ade813da2d22",
"md5": "e070cebdae73bff4c8cf3bda8467b013",
"sha256": "d2a89d7d82250654dd734030add7ba9aa795886e358f031cbd29c2400772ac94"
},
"downloads": -1,
"filename": "mpunittest-0.0.0a6.tar.gz",
"has_sig": false,
"md5_digest": "e070cebdae73bff4c8cf3bda8467b013",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 21711,
"upload_time": "2023-03-27T22:01:06",
"upload_time_iso_8601": "2023-03-27T22:01:06.527593Z",
"url": "https://files.pythonhosted.org/packages/f8/2c/c379aa7be08e5550a7220a3fb1f1cd5c4d1bfdd556670252ade813da2d22/mpunittest-0.0.0a6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-27 22:01:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "mpunittest"
}