Skip to main content

flake8 plugin which checks that a timeout is set to all requests and urllib.request.open calls

Project description

ci pre-commit.ci status codecov

flake8-timeout

flake8 plugin which checks that a timeout is set in all requests and urllib.request.open calls.

  • For example: requests.post('https://example.com') or urllib.request.open('https://example.com') will trigger TIM100
  • requests.post('https://example.com', timeout=5) or urllib.request.open('https://example.com', timeout=5) is expected instead

installation

pip install flake8-timeout

flake8 code

Code Description
TIM100 timeout missing for request call

as a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/pycqa/flake8
    rev: 4.0.1
    hooks:
    -   id: flake8
        additional_dependencies: [flake8-timeout==0.3.0]

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

flake8_timeout-0.3.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

flake8_timeout-0.3.0-py2.py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 2 Python 3

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