Skip to content

Big Data Marker - #27

Merged
eteq merged 13 commits into
astropy:masterfrom
jiffyclub:test-markers
Oct 26, 2011
Merged

eteq merged 13 commits into
astropy:masterfrom
jiffyclub:test-markers

Conversation

@jiffyclub

Copy link
Copy Markdown
Contributor

This pull request implements a scheme for handling tests which should not be run by default. astropy.tests.helper defines a marker called big_data which should be used to mark any test which uses online data. astropy.test() will skip any test marked with @big_data unless the big_data keyword is set to True. (This adds the --runbigdata flag to args in helper.run_tests.)

If tests are run by using py.test at the command line in a tests folder then the decorators will be ignored because py.test will not see the hooks defined in helper.py. I don't think this should be a problem, though.

In the future we can use the same setup for marking tests as slow, or otherwise non-default.

In a tangential change, I changed the pastebin option to run_tests so that it only accepts 'failed' and 'all' as acceptable values (in addition to the default None). Before you could specify pastebin=True which was the same as pastebin='failed' and I didn't like having two options do the same thing. I modified the docstring to make things clear.

@astrofrog

Copy link
Copy Markdown
Member

Looks great! I wonder whether we should use the term remotedata rather than bigdata? At this stage there is nothing to say that some small files won't end up online too. @eteq, what do you think?

@eteq

eteq commented Oct 21, 2011

Copy link
Copy Markdown
Member

I agree remotedata is better - I see it more as an aid for people who aren't currently connected to the internet.

Comment thread astropy/tests/tests/test_skip_me.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be from astropy.tests.helper import big_data and then change the below from helper.big_data to just big_data? Presumably some people will look at these tests as an example, and I think just importing the big_data variable is a bit cleaner to read.

Also, it blows my mind a little that you've written tests for the test-running script. Every time I run it now I'll wonder if I'm going to end up in some sort of permanent loop :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub needs a +1 button. I love that the tester is tested.

@jiffyclub

Copy link
Copy Markdown
Contributor Author

remote_data sounds better, I'll put up an update soon.

@jiffyclub

Copy link
Copy Markdown
Contributor Author

That was some exciting rebasing, but this should be ready with the remote_data changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be assert False? I.e. if the test runs, it should fail, because it shouldn't run, correct? Or does the result of the test depend on whether the remote_data option was specified? My brain hurts...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought was that it should pass if the remote_data option was turned on so that that doesn't result in a scary failure. But you're right that it might be nice if the test failed if it was run without the remote_data option. I was just checking visually that it had been skipped. I'll see what I can do.

@jiffyclub

Copy link
Copy Markdown
Contributor Author

I've modified the test_skip_remote_data so that it will pass if called from the command line or if remote_data=True, but will fail if it is not skipped and remote_data=False. Also, the failure has a helpful message.

@eteq

eteq commented Oct 25, 2011

Copy link
Copy Markdown
Member

I think this is probably ready to go, but one thing I'm not clear on: By default, do remote_data tests run, or not run?

@eteq

eteq commented Oct 25, 2011

Copy link
Copy Markdown
Member

Oh, although it would be good to update the testing guidelines to include information on this along with the rest of the pull request... I think the testing guideline pull request is almost ready to go, so perhaps you can (re)base it on that once it gets pulled into master?

@jiffyclub

Copy link
Copy Markdown
Contributor Author

@remote_data tests are not run by astropy.test() unless it is explicitly told to run them with remote_data=True.

If you're planning to merge Thomas' testing-guidelines branch soon I'll rebase once that's done and update the docs.

@astrofrog

Copy link
Copy Markdown
Member

@jiffyclub - we've now merged the testing-guidelines branch, so you can go ahead and update the docs with this pull request. Thanks!

@eteq

eteq commented Oct 26, 2011

Copy link
Copy Markdown
Member

In that case, perhaps we should merge this now and have you update the docs later?

@jiffyclub

Copy link
Copy Markdown
Contributor Author

I've just rebased on the astropy master so this should be an easy merge if you want to go for it. And I think it's ready to be merged. Either way I'll get to the docs as soon as I can.

@astrofrog

Copy link
Copy Markdown
Member

I'm fine with us merging this and adding the docs later.

eteq added a commit that referenced this pull request Oct 26, 2011
Added remote_data marker for tests that use remote data.
@eteq
eteq merged commit a4a1639 into astropy:master Oct 26, 2011
@eteq

eteq commented Oct 26, 2011

Copy link
Copy Markdown
Member

@jiffyclub Great - once you get back you can issue another pull request to update the guidelines then. Have a good vacation!

keflavich pushed a commit to keflavich/astropy that referenced this pull request Oct 9, 2013
Added remote_data marker for tests that use remote data.
taldcroft pushed a commit to taldcroft/astropy that referenced this pull request May 10, 2014
…rm-sky

Make frame / SkyCoord transform_to accept SkyCoord object
embray added a commit to embray/astropy that referenced this pull request Jan 23, 2015
Add --no-git argument to setup.py, recognized by ah_bootstrap
jeffjennings pushed a commit to jeffjennings/astropy that referenced this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants