conftest.py: Ignore KeyboardInterrupt (#3669)

conftest.py: Ignore KeyboardInterrupt
This commit is contained in:
Dan Ryan
2019-05-26 17:06:39 -04:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Allow KeyboardInterrupt to cancel test suite checks for working internet and ssh
+8
View File
@@ -39,6 +39,10 @@ def check_internet():
for url in ("http://httpbin.org/ip", "http://clients3.google.com/generate_204"):
try:
try_internet(url)
except KeyboardInterrupt:
warnings.warn(
"Skipped connecting to internet: {0}".format(url), RuntimeWarning
)
except Exception:
warnings.warn(
"Failed connecting to internet: {0}".format(url), RuntimeWarning
@@ -59,6 +63,10 @@ def check_github_ssh():
# return_code=255 and say 'Permission denied (publickey).'
c = delegator.run('ssh -T git@github.com')
res = True if c.return_code == 1 else False
except KeyboardInterrupt:
warnings.warn(
"KeyboardInterrupt while checking GitHub ssh access", RuntimeWarning
)
except Exception:
pass
global HAS_WARNED_GITHUB