Metadata-Version: 2.4
Name: unittest-benchmark
Version: 0.1.2
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy>=1.15
Dynamic: license-file

# unittest-benchmark
Check a function has a faster runtime than a given benchmark.

'Faster' is defined as having a significantly lower runtime by `time.perf_counter` according to a Mann-Whitney-Wilcoxon test at, by default, the `0.001` significance level with a sample size of 20.

## Usage

```python
import unittest
from unittest_benchmark import BenchmarkMixin
from my_module import fast_function, slow_function

class MyTestCase(unittest.TestCase, BenchmarkMixin):
    def test_my_function_is_faster(self):
        self.assertIsFaster(faster=fast_function, benchmark=slow_function)

if __name__ == "__main__":
    unittest.main()
```

## License
[MIT](https://choosealicense.com/licenses/mit/)
