diff --git a/intersphinx_registry/registry.json b/intersphinx_registry/registry.json index dfd4491..d5587db 100644 --- a/intersphinx_registry/registry.json +++ b/intersphinx_registry/registry.json @@ -46,7 +46,7 @@ "ipywidgets": ["https://ipywidgets.readthedocs.io/en/latest/", null], "jax": ["https://jax.readthedocs.io/en/latest/", null], "jedi": ["https://jedi.readthedocs.io/en/latest/", null], - "jinja": ["http://jinja.pocoo.org/docs/", null], + "jinja": ["https://jinja.palletsprojects.com/", null], "joblib": ["https://joblib.readthedocs.io/en/latest/", null], "jupyter": ["https://docs.jupyter.org/en/latest/", null], "jupyter-server": ["https://jupyter-server.readthedocs.io/en/stable/", null], diff --git a/pyproject.toml b/pyproject.toml index c2053b2..83271bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ minversion = "7.0" # -n auto: # run @parametrize tests in parallel as some use requests. # requires ptest x-dist -addopts = ["-n","auto", "--strict-config", "--strict-markers", "-ra"] +addopts = ["-n","auto", "--strict-config", "--strict-markers", "-ra",'--durations=10'] filterwarnings = ["error"] log_cli_level = "INFO" testpaths = ["tests"] diff --git a/tests/test_basic.py b/tests/test_basic.py index 889c6ed..93b0e24 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -5,6 +5,10 @@ MAPPING = _get_all_mappings() keys = set(MAPPING.keys()) +TIMEOUT = 5 # sec + +# click does return a 301 instead of a 30 +CLICK_WRONG_301 = 301 @pytest.mark.parametrize("key", list(sorted(keys - {"jinja"}))) def test_format(key: str): @@ -21,7 +25,9 @@ def test_format(key: str): assert obj.endswith("/"), obj assert "readthedocs.org" not in obj assert obj.startswith(url) - requests.head(obj, allow_redirects=True).raise_for_status() + res = requests.head(obj, allow_redirects=True, timeout=TIMEOUT) + res.raise_for_status() + assert res.status_code in (200, 302, CLICK_WRONG_301) @pytest.mark.parametrize("key", list(sorted(keys))) @@ -29,7 +35,10 @@ def test_reach_objects_inv(key: str): for v in MAPPING[key]: if v is None: continue - requests.head(v + "objects.inv").raise_for_status() + res = requests.head(v + "objects.inv", timeout=TIMEOUT) + res.raise_for_status() + assert res.status_code in (200, 302, CLICK_WRONG_301) + def test_bad():