Skip to content

TST: test_find_invalid throws TimeoutError instead of URLError now #15321

Closed

Description

@pllim

This now times out instead of throwing URLError.

______________________________ test_find_invalid _______________________________

    @pytest.mark.remote_data(source="astropy")
    def test_find_invalid():
        # this is of course not a real data file and not on any remote server, but
        # it should *try* to go to the remote server
        with pytest.raises(urllib.error.URLError):
>           get_pkg_data_filename(
                "kjfrhgjklahgiulrhgiuraehgiurhgiuhreglhurieghruelighiuerahiulruli"
            )

astropy/utils/tests/test_data.py:909: 
...
E               TimeoutError: timed out

python3.11/socket.py:706: TimeoutError

Maybe just a matter of adjusting the test?

Activity

  1. draghuram commented on Sep 15, 2023

    @draghuram
    Contributor

    I just ran it on my machine as follows (in "main") and it passes for me.

    `pytest   --remote-data astropy astropy/utils/tests/test_data.py::test_find_invalid
    

    Note that I started with astropy only few days back so it is possible I am missing something here.

  2. pllim commented on Sep 15, 2023

    @pllim
    MemberAuthor

    Thanks for checking. It could be that GitHub is blocking the CI (which ironically is also provided by GitHub), causing a different exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions