Skip to main content

No project description provided

Project description

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

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

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

unittest_benchmark-0.1.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unittest_benchmark-0.1.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file unittest_benchmark-0.1.2.tar.gz.

File metadata

  • Download URL: unittest_benchmark-0.1.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for unittest_benchmark-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c12eec7c89171917f16df7478367ffa46c4cf943f053de4075ed9ac988a8006d
MD5 7b9b13a058d873c7a085bbc0ff259ddb
BLAKE2b-256 e328f754d422c42e1b5c9d4a25a7bfa2056ec0aaa51afaf366e0ba438410b0a6

See more details on using hashes here.

File details

Details for the file unittest_benchmark-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for unittest_benchmark-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e71ecea88e396d274f8460eb624fee2ecdc855f865848478d25f5c0da898e2dd
MD5 1ac18aa582d42ee62e6e74d695699c48
BLAKE2b-256 7f26d59151dfeb61ef9b2188c5074ea4fe24f69232227406a2e9d37b182a3bf1

See more details on using hashes here.

Supported by

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