i-pi-dev_archive
i-pi-dev_archive copied to clipboard
Clean up after tests
When IO tests fail, the files tests/test.pos_1.pdb
and tests/test.pos_1.xyz
can be left in the working tree. The easiest way to do it is probably using with_setup
and making sure the files are gone:
https://nose.readthedocs.org/en/latest/writing_tests.html#test-functions
This might be more robust than trying to make sure that the test function itself is always able to clean up after itself. Another option would be to use a test class (instead of test functions), which can have its own setup and cleanup. Other suggestions are welcome, of course. Whatever the solution, it should be reused for all tests that write files.