Skip to content

Commit 17b5bb4

Browse files
committed
fix(test): test_vaccine imunizacao url is forbidden to be fetched on CI
1 parent 8ab1371 commit 17b5bb4

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

.github/workflows/python-package.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ jobs:
3333

3434
- name: Run jupyterlab with PySUS
3535
run: |
36-
# make run-jupyter-pysus
36+
make run-jupyter-pysus
3737
# make test-jupyter-pysus ## takes too long
3838
3939
- name: Linting & Tests
4040
run: |
41+
export CI=1
4142
poetry install
4243
pre-commit run --all-files
43-
# make test-pysus
44-
45-
- name: Setup tmate session
46-
uses: mxschmitt/action-tmate@v3
44+
make test-pysus

docker/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
privileged: true
1010
environment:
1111
- DISPLAY=:0
12+
- CI=${CI:-0}
1213
volumes:
1314
- /tmp/.X11-unix:/tmp/.X11-unix
1415
entrypoint: ["/entrypoint.sh"]

pysus/online_data/vaccine.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ def elasticsearch_fetch(uri, auth, json_body={}):
107107
print(resp)
108108
total += len(resp["hits"]["hits"])
109109
print(f"Downloaded {total} records\r", end="")
110-
# print(resp)
111-
# print(uri)
112110
yield [h["_source"] for h in resp["hits"]["hits"]]
113111
if "_scroll_id" in resp:
114112
scroll_id = resp["_scroll_id"]

pysus/tests/test_data/test_vaccine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import unittest
23

34
import pandas as pd
@@ -7,8 +8,8 @@
78

89
class VaccineTestCase(unittest.TestCase):
910
@pytest.mark.timeout(15)
11+
@unittest.skipIf(os.getenv("CI"), "Forbidden on CI")
1012
def test_Download(self):
11-
"""Careful! this download can take a long time"""
1213
df = download_covid("BA", only_header=True)
1314
self.assertIsInstance(df, pd.DataFrame)
1415
self.assertEqual(df.shape, (10000, 42))

0 commit comments

Comments
 (0)