Read about our upcoming Code of Conduct on this issue

Commit 42047a19 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Made Runner a context manager as well.

This is just convenient and would also mean a fixture
would be very easy to create.
parent a51734083013
......@@ -88,3 +88,10 @@ class Runner:
resp = requests.delete(self.heptapod.api_url + '/runners',
data=dict(token=self.token))
assert resp.status_code == 204
def __enter__(self):
return self
def __exit__(self, *exc_args):
self.api_delete()
return False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment