If a fixture needs to do some teardown, at the moment it ends up looking a bit like this:
deffixture db do
db = setup_db
teardown fn ->
close_db(db)
end
db
end
It might be nice to provide a better mechanism for teardown code. py.test has it's yield fixtures which are pretty nice, but (failing anything nicer) we could maybe provide a macro named yield/return/something that provides a bit of sugar around the above:
deffixture db do
db = setup_db
yield db, teardown: fn ->
close_db(db)
end
end
If a fixture needs to do some teardown, at the moment it ends up looking a bit like this:
It might be nice to provide a better mechanism for teardown code. py.test has it's yield fixtures which are pretty nice, but (failing anything nicer) we could maybe provide a macro named yield/return/something that provides a bit of sugar around the above: