i-pi-dev_archive icon indicating copy to clipboard operation
i-pi-dev_archive copied to clipboard

Clean up after tests

Open OndrejMarsalek opened this issue 9 years ago • 0 comments

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.

OndrejMarsalek avatar Sep 25 '15 18:09 OndrejMarsalek