Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test TestEso.test_each_survey_and_SgrAstar fails #3135

Closed
juanmcloaiza opened this issue Nov 22, 2024 · 2 comments · Fixed by #3136
Closed

Test TestEso.test_each_survey_and_SgrAstar fails #3135

juanmcloaiza opened this issue Nov 22, 2024 · 2 comments · Fixed by #3136
Milestone

Comments

@juanmcloaiza
Copy link
Contributor

juanmcloaiza commented Nov 22, 2024

The following test fails:

TestEso.test_each_survey_and_SgrAstar

The reason seems to be that the survey ERIS-SPIFFIER is missing from the SGRA_SURVEYS list inside test_eso_remote.py.
I will shortly submit a pull request to add the missing survey.

Output from the test:

$ pytest -P eso -m remote_data --remote-data=any --cov astroquery/eso --cov-config=setup.cfg
=================== test session starts ==================================
platform darwin -- Python 3.9.20, pytest-8.3.3, pluggy-1.5.0

Running tests with astroquery version 0.4.8.dev9622_testrun_testrun.

Running tests with astropy_helpers version 4.0.1.
Running tests in astroquery docs.

Date: 2024-11-22T10:45:59

Platform: macOS-14.7-arm64-i386-64bit

Executable: /Users/jcarmona/miniconda3/envs/py39/bin/python

Full Python Version:
3.9.20 | packaged by conda-forge | (main, Sep 30 2024, 17:48:00)
[Clang 17.0.6 ]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Package versions:
Numpy: 1.26.4
Matplotlib: 3.9.2
Astropy: 6.0.1
regions: 0.8
pyVO: 1.6
mocpy: 0.17.0
astropy-healpix: 1.0.3
vamdclib: not available

Using Astropy options: remote_data: any.

rootdir: /Users/jcarmona/Repos/astroquery
configfile: setup.cfg
testpaths: astroquery, docs
plugins: astropy-0.11.0, cov-6.0.0, remotedata-0.4.1, filter-subpackage-0.2.0, hypothesis-6.119.3, doctestplus-1.2.1, astropy-header-0.2.2, dependency-0.6.0, arraydiff-0.6.1, rerunfailures-15.0, mock-3.14.0
collected 48 items / 10 deselected / 38 selected

astroquery/eso/tests/test_eso_remote.py ......s.............................F.                                                                                                                                                                                                                                                        [100%]

=============== FAILURES ==============================
______________ TestEso.test_each_survey_and_SgrAstar ____________________________

self = <astroquery.eso.tests.test_eso_remote.TestEso object at 0x1285c24c0>, tmp_path = PosixPath('/private/var/folders/yt/891ty7_d69z2_gxb5dgb5t380009m8/T/pytest-of-jcarmona/pytest-8/test_each_survey_and_SgrAstar0')

    def test_each_survey_and_SgrAstar(self, tmp_path):
        eso = Eso()
        eso.cache_location = tmp_path
        eso.ROW_LIMIT = 5

        surveys = eso.list_surveys(cache=False)
        for survey in surveys:
            if survey in SGRA_SURVEYS:
                result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
                                             coord2=-29.00782497,
                                             box='01 00 00',
                                             cache=False)
                assert len(result_s) > 0
            else:
                with pytest.warns(NoResultsWarning):
                    result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
                                                 coord2=-29.00782497,
                                                 box='01 00 00',
                                                 cache=False)
>                   assert result_s is None
E                   assert <Table length=5>\n          ARCFILE             Object   ... REFERENC\n           str27              str10    ...  int64... A ...       --\nADP.2024-07-16T14:10:35.982 NAME Sgr A ...       --\nADP.2024-07-16T14:10:35.989 NAME Sgr A ...       -- is None

astroquery/eso/tests/test_eso_remote.py:179: AssertionError

During handling of the above exception, another exception occurred:

self = <astroquery.eso.tests.test_eso_remote.TestEso object at 0x1285c24c0>, tmp_path = PosixPath('/private/var/folders/yt/891ty7_d69z2_gxb5dgb5t380009m8/T/pytest-of-jcarmona/pytest-8/test_each_survey_and_SgrAstar0')

    def test_each_survey_and_SgrAstar(self, tmp_path):
        eso = Eso()
        eso.cache_location = tmp_path
        eso.ROW_LIMIT = 5

        surveys = eso.list_surveys(cache=False)
        for survey in surveys:
            if survey in SGRA_SURVEYS:
                result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
                                             coord2=-29.00782497,
                                             box='01 00 00',
                                             cache=False)
                assert len(result_s) > 0
            else:
                with pytest.warns(NoResultsWarning):
                    result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
                                                 coord2=-29.00782497,
                                                 box='01 00 00',
                                                 cache=False)
                    assert result_s is None

                    generic_result = eso.query_surveys(surveys=survey)
>                   assert len(generic_result) > 0
E                   Failed: DID NOT WARN. No warnings of type (<class 'astroquery.exceptions.NoResultsWarning'>,) were emitted.
E                    Emitted warnings: [].

astroquery/eso/tests/test_eso_remote.py:182: Failed

---------- coverage: platform darwin, python 3.9.20-final-0 ----------
Name                         Stmts   Miss  Cover
------------------------------------------------
astroquery/eso/__init__.py       8      0   100%
astroquery/eso/core.py         561    215    62%
------------------------------------------------
TOTAL                          569    215    62%

==================== short test summary info =======================================
FAILED astroquery/eso/tests/test_eso_remote.py::TestEso::test_each_survey_and_SgrAstar - Failed: DID NOT WARN. No warnings of type (<class 'astroquery.exceptions.NoResultsWarning'>,) were emitted.
===== 1 failed, 36 passed, 1 skipped, 10 deselected in 71.14s (0:01:11) =========================
@Pharisaeus
Copy link

Won't this test fail again any time there is a new survey including SgrAstar?

@bsipocz bsipocz added this to the v0.4.8 milestone Nov 25, 2024
@bsipocz
Copy link
Member

bsipocz commented Nov 25, 2024

Won't this test fail again any time there is a new survey including SgrAstar?

Yes, it will but we can also view it as a consistency-check, too.

bsipocz added a commit that referenced this issue Nov 25, 2024
Fix #3135 - `TestEso.test_each_survey_and_SgrAstar` fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants