Skip to content

Commit

Permalink
azure-core: ignore Connection header in tests (Azure#24450)
Browse files Browse the repository at this point in the history
Flask includes that since pallets/werkzeug#2399, so test fail on newest Flask versions.
  • Loading branch information
K900 authored and sarkar-rajarshi committed Jun 9, 2022
1 parent 966af81 commit 13a6fce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# flask returns these response headers, which we don't really need for these following tests
RESPONSE_HEADERS_TO_IGNORE = [
"Connection",
"Content-Type",
"Content-Length",
"Server",
Expand All @@ -24,7 +25,7 @@ async def _get_response_headers(request):
response = await client.send_request(request)
response.raise_for_status
for header in RESPONSE_HEADERS_TO_IGNORE:
response.headers.pop(header)
response.headers.pop(header, None)
return response.headers
return _get_response_headers

Expand Down
3 changes: 2 additions & 1 deletion sdk/core/azure-core/tests/test_rest_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def _get_request_headers(header_value):

# flask returns these response headers, which we don't really need for these following tests
RESPONSE_HEADERS_TO_IGNORE = [
"Connection",
"Content-Type",
"Content-Length",
"Server",
Expand All @@ -33,7 +34,7 @@ def _get_response_headers(request):
response = client.send_request(request)
response.raise_for_status
for header in RESPONSE_HEADERS_TO_IGNORE:
response.headers.pop(header)
response.headers.pop(header, None)
return response.headers
return _get_response_headers

Expand Down

0 comments on commit 13a6fce

Please sign in to comment.