Ref #19905: in formtools.tests, move the opening/closing of files in setUp/tearDown.