switched tests to new context manager (`with` statement)