adds assertions attribute for test cases
extracts formatAttributes closure