@hospital.healthcheck
def test_multiple():
errors = []
for domain in 'example.com', 'www.example.com':
try:
hospital.assert_ping(domain)
except AssertionError, e:
errors.append(e)
if errors:
raise AssertionError('\n'.join(errors))
With something like:
@hospital.healthcheck
def test_multiple():
with hospital.multiple_assertions:
for domain in 'example.com', 'www.example.com':
hospital.assert_ping(domain)
In order to replace things like:
With something like: