Skip to content

Commit

Permalink
[resoto][chore] Define codecov settings (#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Jul 19, 2023
1 parent 96ca755 commit bda50a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions codecov.yml
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: auto # Target coverage is auto-detected based on the base commit
threshold: 1% # Allow coverage to drop by up to 1% compared to base commit
patch:
default:
target: 90% # Require each patch to have at least 90% coverage
threshold: 1% # Allow coverage to drop by up to 1% for the patch compared to base commit
6 changes: 3 additions & 3 deletions resotolib/resotolib/utils.py
Expand Up @@ -287,9 +287,9 @@ def get_local_ip_addresses(
for dst_ip in connect_to_ips:
try:
af_inet = socket.AF_INET6 if ":" in dst_ip else socket.AF_INET
s = socket.socket(af_inet, socket.SOCK_DGRAM)
s.connect((dst_ip, 53))
local_address = s.getsockname()[0]
with socket.socket(af_inet, socket.SOCK_DGRAM) as s:
s.connect((dst_ip, 53))
local_address = s.getsockname()[0]
except Exception:
pass
else:
Expand Down

0 comments on commit bda50a1

Please sign in to comment.