Skip to content

Commit ec460eb

Browse files
committed
Add coverage testing
1 parent e3ca7ba commit ec460eb

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

.github/workflows/test_code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
pip install pixelmatch
4242
4343
- name: Code tests
44-
run: python -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots
44+
run: coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots

.github/workflows/test_geopandas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: Run Geopandas tests
4747
run: |
4848
cd geopandas
49-
pytest -r a geopandas/tests/test_explore.py
49+
coverage run -p -m pytest -r a geopandas/tests/test_explore.py

.github/workflows/test_latest_branca.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
run: |
3434
micromamba remove branca --yes --force
3535
python -m pip install git+https://github.com/python-visualization/branca.git
36-
python -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots
36+
coverage run -p -m pytest -vv --ignore=tests/selenium --ignore=tests/playwright --ignore=tests/snapshots

.github/workflows/test_selenium.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434

3535
- name: Selenium tests
3636
shell: bash -l {0}
37-
run: python -m pytest tests/selenium -vv
37+
run: coverage run -p -m pytest tests/selenium -vv

.github/workflows/test_snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Test with pytest
3737
shell: bash -l {0}
3838
run: |
39-
python -m pytest tests/snapshots -s --junit-xml=test-results.xml
39+
coverage run -p -m pytest tests/snapshots -s --junit-xml=test-results.xml
4040
4141
- name: Surface failing tests
4242
if: always()

.github/workflows/test_streamlit_folium.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
shell: bash -l {0}
6767
run: |
6868
cd streamlit_folium
69-
pytest tests/test_frontend.py --browser chromium -s --reruns 3 -k "not test_layer_control_dynamic_update" --junit-xml=test-results.xml
69+
coverage run -p -m tests/test_frontend.py --browser chromium -s --reruns 3 -k "not test_layer_control_dynamic_update"
7070
7171
- name: Surface failing tests
7272
if: always()

folium/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@
4646

4747
try:
4848
from ._version import __version__
49-
except ImportError:
49+
except ImportError: # pragma: no cover
5050
__version__ = "unknown"
5151

5252

5353
if branca.__version__ != "unknown" and tuple(
5454
int(x) for x in branca.__version__.split(".")[:2]
55-
) < (0, 3):
55+
) < (
56+
0,
57+
3,
58+
): # pragma: no cover
5659
raise ImportError(
5760
"branca version 0.3.0 or higher is required. "
5861
"Update branca with e.g. `pip install branca --upgrade`."

tests/snapshots/test_snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_screenshot(path: str):
3535
m.save(f"/tmp/folium_map_{path}.html")
3636
assert mismatch < 200
3737

38-
else:
38+
else: # pragma: no cover
3939
shutil.copy(
4040
f"/tmp/screenshot_new_{path}.png",
4141
f"tests/snapshots/screenshots/screenshot_{path}.png",

0 commit comments

Comments
 (0)