fixing astroquery.MAST remote unit tests#2174
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2174 +/- ##
==========================================
- Coverage 66.11% 61.80% -4.32%
==========================================
Files 418 129 -289
Lines 28180 16287 -11893
==========================================
- Hits 18631 10066 -8565
+ Misses 9549 6221 -3328 Continue to review full report at Codecov.
|
If you wish to link an issue to your pull request then you need to use a keyword GitHub recognizes. See here: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword |
|
Given you added |
|
Sounds good @bsipocz |
|
Hello @jaymedina! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-11-13 00:32:40 UTC |
|
This is almost ready to go @bsipocz . I have a question regarding some of the unit tests in Tesscut and Zcut. There are some unit tests that are intentionally trying to retrieve a table with no results, but pytest crashes on these unit tests with a Do you know of another workaround for this or should I just remove these tests? Edit: Some unit tests are unintentionally breaking with the |
|
In the tests that intentionally trigger a warning it would be best to use the astroquery/astroquery/imcce/tests/test_skybot.py Lines 63 to 65 in 77986a0 |
|
That worked, thanks! |
|
All tests are now passing and the PR is ready for review + merge @bsipocz . There's one test that's creating a bottleneck, I'm assuming this has always been the case. It's probably one of the download ones. If it's a concern, I can look into it. cc: @tomdonaldson |
|
You you fix the style breakage to make sure CI is running on this? Locally this should come back without any issues: Also, please rebase as there shouldn't be any merge commits in there. I'll do the review once we have a passing CI. |
|
@jaymedina - something went very wrong with the rebase, could you ask someone at ST to walk you through it (basically no pulls should be done, and absolutely no unrelated commits should be in the PR). Also, the test failure is genuine, running tests locally should pass with and without |
16eb567 to
5a05168
Compare
|
Fixed it @bsipocz - the issue was instead of running |
bsipocz
left a comment
There was a problem hiding this comment.
Two remaining tests are failing due to undefined variables used, but the rest looks OK, with minor nitpicks.
|
|
||
| def test_observations_download_file(self, tmpdir): | ||
| test_obs_id = '2003600312' | ||
| test_obs_id = OBSID |
|
|
||
| def test_observations_download_products(self, tmpdir): | ||
| test_obs_id = '2003600312' | ||
| test_obs_id = OBSID |
There was a problem hiding this comment.
This produces a NameError. Did you plan to have OBSID as a test parameter, or reuse something from another test?
| result = mast.Catalogs.query_region("158.47924 -7.30962", | ||
| radius=in_radius, | ||
| catalog="Gaia") | ||
| row = np.where(result['source_id'] == '3774902350511581696') |
There was a problem hiding this comment.
Nitpick, but it's good practice to use more descriptive variable names, those are helpful when someone comes back to this code, it's enough to reach fewer lines to get the context, so e.g. here it's not a row object, but a row index.
(We're not very good with this practice in the package, I think there are still a few single-letter variables, so as I said this is very much a nitpick only :) )
|
This could use some stashing to reduce the number of commits to logical chunks, but otherwise I've switched the PRs status as it fixes all but two tests. I'll go ahead apply my comments and do some stashing of the pep8 stuff before merging. |
Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
…ssertions, removing explicit table size assertions.
…n tesscut (changes to new target coordinates). commented out some unit tests that returned a NoResultsWarning
…nd unused imports
e0fe77f to
4bbcd45
Compare
| assert isinstance(result, Table) | ||
| assert len(result) == sum(products['productType'] == "SCIENCE") | ||
|
|
||
| # test downloads 150+ files, 50MB+, TODO: revise OBSID to query only a few, small files for download |
There was a problem hiding this comment.
The code snippet from this test takes an awfully long time, I've cancelled it after many minutes, when it already downloaded 150+ files, and 50MB+. I'll open a separate issue as a reminder that the test needs to be fixed in a way that only a very small data download should happen at test time.
|
Thanks @jaymedina! and @eerovaher for helping with the review! |
Closes #2172