Loading lib/galaxy/dependencies/dev-requirements.txt +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ pytest-asyncio==0.20.3 ; python_version >= "3.7" and python_version < "3.12" pytest-celery==0.0.0 ; python_version >= "3.7" and python_version < "3.12" pytest-cov==4.0.0 ; python_version >= "3.7" and python_version < "3.12" pytest-html==3.2.0 ; python_version >= "3.7" and python_version < "3.12" pytest-httpserver==1.0.6 ; python_version >= "3.7" and python_version < "3.12" pytest-json-report==1.5.0 ; python_version >= "3.7" and python_version < "3.12" pytest-metadata==2.0.4 ; python_version >= "3.7" and python_version < "3.12" pytest-mock==3.10.0 ; python_version >= "3.7" and python_version < "3.12" Loading packages/util/test-requirements.txt +1 −0 Original line number Diff line number Diff line pytest pytest-httpserver responses pyproject.toml +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ pytest-asyncio = "*" pytest-celery = "*" pytest-cov = "*" pytest-html = "*" pytest-httpserver = "*" python-irodsclient = "!=1.1.2" # https://github.com/irods/python-irodsclient/issues/356 pytest-json-report = "*" pytest-mock = "*" Loading test/unit/util/test_get_url.py +3 −4 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ import requests import responses from galaxy.util import url_get from galaxy.util.unittest_utils import skip_if_site_down @responses.activate Loading @@ -23,11 +22,11 @@ def test_get_url_forbidden(): assert "403 Client Error: Forbidden for url: https://toolshed.g2.bx.psu.edu/" in str(excinfo) @skip_if_site_down("https://httpbin.org") def test_get_url_retry_after(): def test_get_url_retry_after(httpserver): # This test is not ideal since it contacts an external resource # and doesn't actually verify multiple attempts have been made. # responses doesn't mock the right place to fully simulate this. url = "https://httpbin.org/status/429" httpserver.expect_request("/429").respond_with_data("try again later", status=429, content_type="text/plain") url = httpserver.url_for("/429") with pytest.raises(requests.exceptions.RetryError): url_get(url, max_retries=2, backoff_factor=0.01) Loading
lib/galaxy/dependencies/dev-requirements.txt +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ pytest-asyncio==0.20.3 ; python_version >= "3.7" and python_version < "3.12" pytest-celery==0.0.0 ; python_version >= "3.7" and python_version < "3.12" pytest-cov==4.0.0 ; python_version >= "3.7" and python_version < "3.12" pytest-html==3.2.0 ; python_version >= "3.7" and python_version < "3.12" pytest-httpserver==1.0.6 ; python_version >= "3.7" and python_version < "3.12" pytest-json-report==1.5.0 ; python_version >= "3.7" and python_version < "3.12" pytest-metadata==2.0.4 ; python_version >= "3.7" and python_version < "3.12" pytest-mock==3.10.0 ; python_version >= "3.7" and python_version < "3.12" Loading
packages/util/test-requirements.txt +1 −0 Original line number Diff line number Diff line pytest pytest-httpserver responses
pyproject.toml +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ pytest-asyncio = "*" pytest-celery = "*" pytest-cov = "*" pytest-html = "*" pytest-httpserver = "*" python-irodsclient = "!=1.1.2" # https://github.com/irods/python-irodsclient/issues/356 pytest-json-report = "*" pytest-mock = "*" Loading
test/unit/util/test_get_url.py +3 −4 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ import requests import responses from galaxy.util import url_get from galaxy.util.unittest_utils import skip_if_site_down @responses.activate Loading @@ -23,11 +22,11 @@ def test_get_url_forbidden(): assert "403 Client Error: Forbidden for url: https://toolshed.g2.bx.psu.edu/" in str(excinfo) @skip_if_site_down("https://httpbin.org") def test_get_url_retry_after(): def test_get_url_retry_after(httpserver): # This test is not ideal since it contacts an external resource # and doesn't actually verify multiple attempts have been made. # responses doesn't mock the right place to fully simulate this. url = "https://httpbin.org/status/429" httpserver.expect_request("/429").respond_with_data("try again later", status=429, content_type="text/plain") url = httpserver.url_for("/429") with pytest.raises(requests.exceptions.RetryError): url_get(url, max_retries=2, backoff_factor=0.01)