def check_and_raise(): x = Interface(config='.xnat.cfg') try: x.head('') print('Docker instance found.') except ConnectionError: print('Skipping it.') raise SkipTest('Docker-based XNAT instance unavailable')
def check_and_raise(): x = Interface(config='.xnat.cfg') try: x.head('') list(x.select.projects()) print('Docker instance found.') except (ConnectionError, KeyError): print('Skipping it.') raise SkipTest('Docker-based XNAT instance unavailable')