Skip to content

Commit 823bf1d

Browse files
committed
fix tests
1 parent 9816a5e commit 823bf1d

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
hooks:
2727
- id: blackdoc
2828

29-
- repo: https://github.com/astral-sh/ruff-pre-commit
29+
- repo: https://github.com/charliermarsh/ruff-pre-commit
3030
rev: v0.15.8
3131
hooks:
3232
- id: ruff

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ exclude .gitignore
1414
global-exclude *.nc
1515
global-exclude *.yaml
1616
global-exclude *.yml
17-

ioos_pkg_skeleton/ioos_pkg_skeleton.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def meaning_of_life(n: int) -> np.ndarray:
1212

1313
def meaning_of_life_url() -> str:
1414
"""Fetch the meaning of life from https://en.wikipedia.org/wiki/Main_Page."""
15+
headers = {"User-Agent": "IOOS-SKELETON/0.0 ; ioos-skeleton@example.org)"}
1516
url = "https://en.wikipedia.org/api/rest_v1/page/summary/Monty_Python's_The_Meaning_of_Life"
16-
r = requests.get(url, timeout=10)
17+
r = requests.get(url, headers=headers, timeout=10)
1718
r.raise_for_status()
1819
j = r.json()
1920
return j["extract"]

tests/test_ioos_pkg_skeleton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_meaning_of_life_url():
1818

1919
def test_meaning_of_life():
2020
"""Test meaning_of_life function."""
21-
answer, n = 2, 42
21+
n, answer = 2, 42
2222
ret = meaning_of_life(n)
2323
assert isinstance(ret, np.ndarray)
2424
assert np.unique(ret) == answer

0 commit comments

Comments
 (0)