Skip to content

Commit 3c0c156

Browse files
authored
Merge pull request #2 from eldaduzman/fix-readme
fix readme.md
2 parents 00b7e80 + 813c953 commit 3c0c156

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

README.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
11
# python-perf-unit
2-
Decorators and utilities for python performance unit testing
2+
3+
4+
[![Version](https://img.shields.io/pypi/format/python-perf-unit)](https://pypi.python.org/pypi/python-perf-unit)
5+
<!-- ![](https://raw.githubusercontent.com/eldaduzman/robotframework-gevent/main/docs/badges/coverage-badge.svg) -->
6+
<!-- ![](https://raw.githubusercontent.com/eldaduzman/robotframework-gevent/main/docs/badges/pylint.svg) -->
7+
<!-- ![](https://raw.githubusercontent.com/eldaduzman/robotframework-gevent/main/docs/badges/mutscore.svg) -->
8+
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10+
11+
`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.
12+
13+
## Features
14+
15+
- **Performance Testing**: Automatically times unittest test methods.
16+
- **Median Execution Time Assertion**: Asserts median execution time of test methods is below a specified threshold.
17+
- **Parallel Execution**: Runs tests in parallel using multithreading.
18+
- **Percentile Reporting**: Detailed percentile reports for test execution times.
19+
20+
## Installation
21+
22+
```bash
23+
pip install python-perf-unit
24+
```
25+
26+
## Usage
27+
Decorate your unittest class with `@perf_unit_test_class` to turn standard unit tests into performance tests.
28+
29+
```python
30+
31+
from perf_unit import perf_unit_test_class
32+
import unittest
33+
34+
@perf_unit_test_class
35+
class MyTestCase(unittest.TestCase):
36+
37+
def test_example1(self):
38+
# Your test code here
39+
40+
def test_example2(self):
41+
# Another test code
42+
43+
if __name__ == '__main__':
44+
unittest.main()
45+
46+
47+
```
48+
49+
## Code styling
50+
### `black` used for auto-formatting code [read](https://pypi.org/project/black/),
51+
### `pylint` used for code linting and pep8 compliance [read](https://pypi.org/project/pylint/),
52+
### `mypy` used for type hinting [read](https://pypi.org/project/mypy/),

0 commit comments

Comments
 (0)