﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
3947	Use `async def` for tests in src/allmydata/test/mutable/test_version.py	exarkun	GitHub <noreply@…>	"Since Twisted 22.8 we can write `async def` test methods (with either trial or testtools).

Let's do some of that.

The transformation is basically mechanical.

{{{
def test_foo(self):
   d = some_deferred()
   d.addCallback(lambda x: some_function(x))
   return d
}}}

becomes either

{{{
async def test_foo(self):
    x = await some_deferred()
    some_function(x)
}}}

or

{{{
async def test_foo(self):
    x = await some_deferred()
    await some_function(x)
}}}

`Deferred.addCallback(f)` is happy whether `f` returns a `Deferred` or not but `await f()` only works if `f` returns an awaitable - thus the choice to make above.
"	defect	closed	normal	undecided	unknown	n/a	fixed			
