Skip to content

Commit e99e93f

Browse files
author
Leo Alt
committed
Fix pylint warning
1 parent 7bfec3b commit e99e93f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

scripts/common/rest_api_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def query_api(url: str, params: Mapping[str, str], debug_requests=False) -> dict
4848
if len(params) > 0:
4949
print(f'QUERY: {params}')
5050

51-
response = requests.get(url, params=params)
51+
response = requests.get(url, params=params, timeout=60)
5252
response.raise_for_status()
5353

5454
if debug_requests:
@@ -67,7 +67,7 @@ def download_file(url: str, target_path: Path, overwrite=False):
6767
if not overwrite and target_path.exists():
6868
raise FileAlreadyExists(f"Refusing to overwrite existing file: '{target_path}'.")
6969

70-
with requests.get(url, stream=True) as request:
70+
with requests.get(url, stream=True, timeout=60) as request:
7171
with open(target_path, 'wb') as target_file:
7272
shutil.copyfileobj(request.raw, target_file)
7373

test/scripts/test_externalTests_benchmark_downloader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _git_run_command_mock(command):
3131
"If you have updated the code, please remember to add matching command fixtures above."
3232
)
3333

34-
def _requests_get_mock(url, params):
34+
def _requests_get_mock(url, params, timeout):
3535
response_mock = Mock()
3636

3737
if url == 'https://api.github.com/repos/ethereum/solidity/pulls/12818':
@@ -174,6 +174,7 @@ def _requests_get_mock(url, params):
174174
"The test tried to perform an unexpected GET request.\n"
175175
f"URL: {url}\n" +
176176
(f"query: {params}\n" if len(params) > 0 else "") +
177+
f"timeout: {timeout}\n" +
177178
"If you have updated the code, please remember to add matching response fixtures above."
178179
)
179180

0 commit comments

Comments
 (0)