Closed rrjbca closed 3 years ago
However, I wonder whether
unittest.mock
is more suitable for mocking files, so we don't need to create temporary files or have empty yml files(?)
This PR is not mocking any files. It is implementing a more robust method (a temporary directory) to automatically handle the deletion of files created by the skypy script during testing. We don't want to mock those files; the fundamental purpose of these unit tests is to check that those files are created correctly. Mocking config files might be possible but is unrelated to the issue this PR is addressing and I don't see an obvious benefit?
Description
Use pytest
tmp_path
fixture in unit tests. Creates a temporary directory where temporary files can be written and handles cleanup automatically. Resolves #466Checklist