Skip to content

Commit

Permalink
Skip if not on Py3
Browse files Browse the repository at this point in the history
  • Loading branch information
olegsobolev committed Oct 10, 2024
1 parent 2e7ba6b commit 67bae6a
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions iotbx/regression/tst_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
from iotbx.pdb.fetch import fetch, get_link
from libtbx.test_utils import assert_lines_in_text
import sys

def exercise_1():
string_1yjp = fetch(id = "1yjp").read().decode()
Expand Down Expand Up @@ -45,16 +46,17 @@ def exercise_get_link():

if (__name__ == "__main__"):
exercise_get_link()
exception_occured = False
try:
r = requests.get('https://search.rcsb.org/')
except Exception:
print("OK but exception.")
exception_occured = True
if not exception_occured and r.ok and len(r.text) > 100:
exercise_1()
exercise_2()
print("OK")
else:
print("OK but skipped.")
if sys.version_info.major >= 3:
exception_occured = False
try:
r = requests.get('https://search.rcsb.org/')
except Exception:
print("OK but exception.")
exception_occured = True
if not exception_occured and r.ok and len(r.text) > 100:
exercise_1()
exercise_2()
print("OK")
else:
print("OK but skipped.")
print(format_cpu_times())

0 comments on commit 67bae6a

Please sign in to comment.