diff options
author | Moises Lopez - https://www.vauxoo.com/ <moylop260@vauxoo.com> | 2022-06-23 00:48:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-23 07:48:29 +0200 |
commit | 76bcfda64d4fef8706d06ad9458ef2461bf762a0 (patch) | |
tree | 91bac8f7e3beb70db207548fd649780e9f07fc1e /requirements_test_min.txt | |
parent | 02e9023865419635f155d8c8a6dc1b14d5104d3c (diff) | |
download | pylint-git-76bcfda64d4fef8706d06ad9458ef2461bf762a0.tar.gz |
[ADD] missing-timeout: Used when a method call an external request (#6780)
Calling external request needs to use timeout in order to avoid waiting for a long time
You can even reproduce the case using deelay.me
e.g.
```python
import requests
response = requests.get("https://deelay.me/5000/http://localhost:80") # It will spend 5s
response = requests.get("https://deelay.me/5000/http://localhost:80", timeout=2) # timeout
response = requests.get("https://deelay.me/1000/http://localhost:80", timeout=2) # fine
```
After 2s if the request doesn't have response it raises the following exception
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='deelay.me', port=443): Read timed out. (read timeout=2)
But if it responses <=1s it is fine
Now you can test the same but using a bigger delay
Diffstat (limited to 'requirements_test_min.txt')
-rw-r--r-- | requirements_test_min.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/requirements_test_min.txt b/requirements_test_min.txt index 386f2605c..f93c408ae 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -5,3 +5,4 @@ typing-extensions~=4.2 pytest~=7.1 pytest-benchmark~=3.4 pytest-timeout~=2.1 +requests |