physionet-build
physionet-build copied to clipboard
Test suite leaving behind 'training-report.pdf' files
One of the test cases is generating files under media/test
and not cleaning them up afterwards:
$ ./manage.py test
[...]
$ find ../media/test/
../media/test/
../media/test/training
../media/test/training/training-report.pdf
../media/test/training/mdudMcv1nv6LroMtnLdp
../media/test/training/mdudMcv1nv6LroMtnLdp/training-report.pdf
I'm guessing this is a recent change?
It's not a huge issue, but:
-
If a test case requires creating files, in
media/test
or elsewhere, then those files should be deleted bytearDown
. An easy way to handle this is for the TestCase class to inherit fromuser.test_views.TestMixin
(as most of the project tests do.) (Granted, the TestMixin class could be better named, better documented, and is overkill in many cases.) -
media/test
should be ignored by.gitignore