Skip to content

Commit bed7f8b

Browse files
committed
Merge branch 'oauth2' into assemble
2 parents 088ef93 + 87dbc05 commit bed7f8b

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/test_client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
except: # Python 3
77
from urllib.parse import urljoin
88
import time
9-
try:
10-
FileNotFoundError # Python 3
11-
except NameError:
12-
FileNotFoundError = IOError # Python 2
139

1410
import requests
1511

@@ -48,12 +44,14 @@ def load_conf(filename):
4844
"placeholder": null
4945
}
5046
"""
51-
try:
47+
conf = {}
48+
if os.path.exists(filename):
5249
with open(filename) as f:
5350
conf = json.load(f)
54-
except FileNotFoundError:
55-
raise unittest.SkipTest(
56-
"Unable to open/read JSON configuration %s" % filename)
51+
else:
52+
# Do not raise unittest.SkipTest(...) here,
53+
# because it would still be considered as Test Error in Python 2
54+
logger.warning("Unable to locate JSON configuration %s" % filename)
5755
openid_configuration = {}
5856
if "oidp" in conf:
5957
try:

0 commit comments

Comments
 (0)