-
Notifications
You must be signed in to change notification settings - Fork 21
added remote-data decorator to BaseImageTests class #67
Conversation
@anizami - maybe it would make sense instead to not pre-download the files in the setup_class, but only when needed directly in the tests. Then you can have more control over which tests to skip. We used to have it in |
@anizami - thanks! It looks like some more tests make use of |
@astrofrog - Yeah I noticed. It's actually a bit trickier than just calling datasets inside a test. I've noticed that it doesn't cache unless datasets is called inside setup_class..trying to fix that right now. |
@astrofrog - Is there a way I can check inside a function whether or not |
@anizami - good question, I'm not sure! Weird that the caching isn't working, it could be because the tests each have their own cache to ensure no overlap. Is it really slow if the cache doesn't get used? |
@astrofrog - Yep, annoyingly slow |
@anizami - ok, if there is no easy way to do it, then leave the decorator on the class as before, and it's ok if it skips all image tests. |
@astrofrog - hmm okay. It's not as satisfying though. By the way, |
@@ -67,9 +68,8 @@ def test_image_plot(self, generate): | |||
# Test for overlaying contours on images | |||
@remote_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove @remote_data
from these tests now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll do that.
@anizami - I think the solution is going to be that since many of the tests don't need the actual image data, we could store the FITS headers in the repository and only use |
@astrofrog - turns out we do use |
@anizami - you can just hard-code the sizes - just print out the shapes and enter them manually :) |
@astrofrog - ah of course.. |
@astrofrog - by the way, do you have a preference about which directory to keep the header files in? |
Maybe you can make a |
Sure |
@astrofrog - the |
Summary: all the headers are now in the |
@@ -16,13 +16,14 @@ | |||
|
|||
|
|||
class BaseImageTests(object): | |||
|
|||
# TODO: move header files to data directory, add them to config files so they get copied over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah forgot about this.
Looks great, and works nicely! |
added remote-data decorator to BaseImageTests class
added remote-data decorator to BaseImageTests class
I had to add the decorator to the
BaseImageTests
class because the images were downloaded in thesetup_class
method. Nowpython setup.py test
skips all the tests intest_images.py
andtest_transform_coord_meta.py
. Is that a problem?