Merge pull request #13444 from ethereum/fix_pylint

Fix pylint warning
This commit is contained in:
Leo 2022-08-29 12:44:32 +02:00 committed by GitHub
commit 409f3b44aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,7 @@ def query_api(url: str, params: Mapping[str, str], debug_requests=False) -> dict
if len(params) > 0:
print(f'QUERY: {params}')
response = requests.get(url, params=params)
response = requests.get(url, params=params, timeout=60)
response.raise_for_status()
if debug_requests:
@ -67,7 +67,7 @@ def download_file(url: str, target_path: Path, overwrite=False):
if not overwrite and target_path.exists():
raise FileAlreadyExists(f"Refusing to overwrite existing file: '{target_path}'.")
with requests.get(url, stream=True) as request:
with requests.get(url, stream=True, timeout=60) as request:
with open(target_path, 'wb') as target_file:
shutil.copyfileobj(request.raw, target_file)

View File

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