execution-asserts-0.0.3
توضیحات
A collection of asserts for methods execution
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | execution-asserts-0.0.3 |
| نام | execution-asserts |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Amir Mofakhar |
| ایمیل نویسنده | amir@mofakhar.info |
| آدرس صفحه اصلی | https://github.com/pangan/execution_asserts |
| آدرس اینترنتی | https://pypi.org/project/execution-asserts/ |
| مجوز | - |
[](https://badge.fury.io/py/execution-asserts)
[](https://pypi.python.org/pypi/execution-asserts/)
[](https://pypi.python.org/pypi/execution-asserts/)
# execution-asserts
A collection of asserts for testing performance of the methods.
## List of asserts
`assertMaximumExecutionTime(max_execution_time_seconds, func, *args, **kwargs)`
`assertMaximumMemoryUsage(max_memory_usage, func, *args, **kwargs)`
## How to use
Look at this sample :
import unittest
from execution_assets import ExecutionTest
def my_method(input_parameter):
pass
class MyTestCase(unittest.TestCase, ExecutionTest):
def test_execution_time(self):
self.assertMaximumExecutionTime(0.3, my_method, 'test_value')
def test_memory_usage(self):
self.assertMaximumMemoryUsage(12, my_method, 'test_value')
نیازمندی
| مقدار | نام |
|---|---|
| - | memory-profiler |
نحوه نصب
نصب پکیج whl execution-asserts-0.0.3:
pip install execution-asserts-0.0.3.whl
نصب پکیج tar.gz execution-asserts-0.0.3:
pip install execution-asserts-0.0.3.tar.gz