ENH: better handling of test files