Tests: DRY out logging tests

Might solve, but might be better with a third opinion. Maybe no changes are necessary here.

cc @jzaefferer