Skip to main content

Duration Check

Working python decorators to check how long function can take to be executed.

Decorator available

  • timeout via timeout_decorator_builder()
  • duration

Code example

import sys
import unittest

from duration_check import timeout_decorator_builder

# This CAN NOT be a lambda function because we can't pickle them
def module_getter():
    return sys.modules[__name__]

timeout = timeout_decorator_builder(module_getter)  # This CAN NOT be a lambda function because we can't pickle them

class SuperTaskUnitTest(unittest.TestCase):

    @timeout(2)
    def test_timeout_super_task(self):
        self.assertTrue(my_super_task())

Issues/Bug report or improvement ideas

https://gitlab.com/devolive/pypi-packages/duration-check/-/issues

License

GNU Lesser General Public License v3 or later (LGPLv3+)

Metadata

Release files for duration-check 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duration-check 1.0.4
File Size Uploaded Provenance Actions
duration_check-1.0.4.tar.gz 5.8 kB Without provenance Details for duration_check-1.0.4.tar.gz

Release files / duration_check-1.0.4.tar.gz

Download URL duration_check-1.0.4.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2584b1b3c33d03d8cf16088bb43a6cc7f96ade356bd01367b9545bf4beced76b
BLAKE2b-256 checksum
How to use checksums
f4556301eacbd98d63b2054ae04155b5c740c0120f9a83c4d681e312c25d0086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Security for duration-check 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page