Refactor flake8 tests to use real temporary files.