python-perf-unit


Namepython-perf-unit JSON
Version 0.1.1b0 PyPI version JSON
download
home_pagehttps://github.com/eldaduzman/python-perf-unit
SummaryDecorators and utilities for python performance unit testing
upload_time2023-12-20 08:48:30
maintainer
docs_urlNone
authorEldad Uzman
requires_python>=3.8,<4.0
licenseMIT
keywords performance python unittesting performanetesting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # python-perf-unit


[![Version](https://img.shields.io/pypi/v/python-perf-unit)](https://pypi.python.org/pypi/python-perf-unit)
![](https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/badges/coverage-badge.svg)
![](https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/badges/pylint.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


<br/>

<div style="text-align:center"><img src="https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/images/logo.png" width="70%" /></div>

<br/>
<br/>


## `python-perf-unit` is a Python package designed to enhance unit testing with performance metrics. By integrating with Python's unittest framework, it enables the execution of test methods with performance analysis.

## Features

- **Performance Testing**: Automatically times unittest test methods.
- **Median Execution Time Assertion**: Asserts median execution time of test methods is below a specified threshold.
- **Parallel Execution**: Runs tests in parallel using multithreading.
- **Percentile Reporting**: Detailed percentile reports for test execution times.

## Installation

```bash
pip install python-perf-unit
```

## Usage
Decorate your unittest class with `@perf_unit_test_class` to turn standard unit tests into performance tests.

```python

from perf_unit import perf_unit_test_class
import unittest

@perf_unit_test_class
class MyTestCase(unittest.TestCase):

    def test_example1(self):
        # Your test code here
        pass

    def test_example2(self):
        # Another test code
        pass

if __name__ == '__main__':
    unittest.main()


```

## Code styling
### `black` used for auto-formatting code [read](https://pypi.org/project/black/),
### `pylint` used for code linting and pep8 compliance [read](https://pypi.org/project/pylint/),
### `mypy` used for type hinting [read](https://pypi.org/project/mypy/),

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eldaduzman/python-perf-unit",
    "name": "python-perf-unit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "performance,python,unittesting,performanetesting",
    "author": "Eldad Uzman",
    "author_email": "eldadu1985@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/c5/22a5059d6a6f3246044d2ed985421781bcc6b48d636e081ca493cd45bb11/python_perf_unit-0.1.1b0.tar.gz",
    "platform": null,
    "description": "# python-perf-unit\n\n\n[![Version](https://img.shields.io/pypi/v/python-perf-unit)](https://pypi.python.org/pypi/python-perf-unit)\n![](https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/badges/coverage-badge.svg)\n![](https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/badges/pylint.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n<br/>\n\n<div style=\"text-align:center\"><img src=\"https://raw.githubusercontent.com/eldaduzman/python-perf-unit/main/docs/images/logo.png\" width=\"70%\" /></div>\n\n<br/>\n<br/>\n\n\n## `python-perf-unit` is a Python package designed to enhance unit testing with performance metrics. By integrating with Python's unittest framework, it enables the execution of test methods with performance analysis.\n\n## Features\n\n- **Performance Testing**: Automatically times unittest test methods.\n- **Median Execution Time Assertion**: Asserts median execution time of test methods is below a specified threshold.\n- **Parallel Execution**: Runs tests in parallel using multithreading.\n- **Percentile Reporting**: Detailed percentile reports for test execution times.\n\n## Installation\n\n```bash\npip install python-perf-unit\n```\n\n## Usage\nDecorate your unittest class with `@perf_unit_test_class` to turn standard unit tests into performance tests.\n\n```python\n\nfrom perf_unit import perf_unit_test_class\nimport unittest\n\n@perf_unit_test_class\nclass MyTestCase(unittest.TestCase):\n\n    def test_example1(self):\n        # Your test code here\n        pass\n\n    def test_example2(self):\n        # Another test code\n        pass\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n```\n\n## Code styling\n### `black` used for auto-formatting code [read](https://pypi.org/project/black/),\n### `pylint` used for code linting and pep8 compliance [read](https://pypi.org/project/pylint/),\n### `mypy` used for type hinting [read](https://pypi.org/project/mypy/),\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Decorators and utilities for python performance unit testing",
    "version": "0.1.1b0",
    "project_urls": {
        "Homepage": "https://github.com/eldaduzman/python-perf-unit",
        "Repository": "https://github.com/eldaduzman/python-perf-unit"
    },
    "split_keywords": [
        "performance",
        "python",
        "unittesting",
        "performanetesting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dec522a5059d6a6f3246044d2ed985421781bcc6b48d636e081ca493cd45bb11",
                "md5": "e3558a3896cfd416dcab53fa597fb0f9",
                "sha256": "945948e7ad993716a82728cf932b7c7efaab675c906a858439a16dcf8a41b10a"
            },
            "downloads": -1,
            "filename": "python_perf_unit-0.1.1b0.tar.gz",
            "has_sig": false,
            "md5_digest": "e3558a3896cfd416dcab53fa597fb0f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 3598,
            "upload_time": "2023-12-20T08:48:30",
            "upload_time_iso_8601": "2023-12-20T08:48:30.098821Z",
            "url": "https://files.pythonhosted.org/packages/de/c5/22a5059d6a6f3246044d2ed985421781bcc6b48d636e081ca493cd45bb11/python_perf_unit-0.1.1b0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-20 08:48:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eldaduzman",
    "github_project": "python-perf-unit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "python-perf-unit"
}
        
Elapsed time: 0.15430s