Skip to main content

A collection of asserts for methods execution

Project description

PyPI version PyPI download month PyPI pyversions

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')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

execution_asserts-0.0.3.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

execution_asserts-0.0.3-py2-none-any.whl (7.5 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page