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.1.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.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unittest_benchmark-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3e5a9044862ffe7ac26be51b73988a7c58da1153d96d6bb4602971964c1376c5
MD5 adb864472ae0373f3bdc0116e50f11aa
BLAKE2b-256 fe17a154c40bb061d773bd405986cd6594947df2ca2da3e75d2daf0c6310557f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unittest_benchmark-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 762942bc2986cf99789e7bc19ed8db68b1e43dadaaca45bef5ca9fe0a30f2abc
MD5 cc0850326d4b89acdf861c04f4756619
BLAKE2b-256 9a25e3eb59e8953013a95b758685b11cbb85678da0eccef1ac1b8189378c7033

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