Skip to content

Commit

Permalink
use lcov format, remove unneeded imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 19, 2025
1 parent 95761d2 commit f43bea5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ jobs:
python -m pip check || true
- name: Test RavenPy
run: |
python -m pytest --cov=ravenpy --numprocesses=logical
python -m pytest --numprocesses=logical --cov=src/ravenpy --cov-report=lcov
- name: Report Coverage
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ htmlcov/
.coverage.*
.cache
nosetests.xml
coverage.lcov
coverage.xml
*.cover
.hypothesis/
Expand Down
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,13 @@ values = [
[tool.codespell]
ignore-words-list = "astroid,documen,socio-economic"

[tool.coverage.paths]
source = ["src/ravenpy/", "*/site-packages/ravenpy/"]

[tool.coverage.run]
relative_files = true
omit = ["tests/*.py"]
source = ["ravenpy"]

[tool.flit.sdist]
include = [
Expand Down Expand Up @@ -319,19 +323,26 @@ warn_required_dynamic_aliases = true
warn_untyped_fields = true

[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"--verbose",
"--color=yes",
"--strict-config",
"--strict-markers",
"--tb=native",
"--numprocesses=0",
"--maxprocesses=8",
"--dist=worksteal"
]
python_files = "test_*.py"
norecursedirs = ["src", ".git", "bin"]
norecursedirs = ["docs/notebooks"]
filterwarnings = ["ignore::UserWarning"]
testpaths = "tests"
testpaths = [
"tests"
]
pythonpath = [
"src"
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"online: mark tests that require external services (deselect with '-m \"not online\"')"
Expand Down
1 change: 0 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
from collections.abc import Sequence
from shutil import copyfile
from textwrap import dedent
from typing import Union

Expand Down
2 changes: 0 additions & 2 deletions tests/test_coords.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import xarray as xr

from ravenpy.utilities.coords import infer_scale_and_offset
from ravenpy.utilities.testdata import open_dataset

Expand Down
18 changes: 8 additions & 10 deletions tests/test_geoserver.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import os
import sys
import tempfile
import urllib.request

import numpy as np
import pytest

pytestmark = pytest.mark.online

# FIXME: Remove XFAIL marks once OWSLib > 0.24.1 is released.


@pytest.mark.online
class TestHydroBASINS:
geoserver = pytest.importorskip("ravenpy.utilities.geoserver")

Expand All @@ -23,13 +21,10 @@ def test_select_hybas_na_domain_bbox(self):
dom = self.geoserver.select_hybas_domain(bbox=bbox)
assert dom == "na"


if os.getenv("CONDA_DEFAULT_ENV") == "raven-dev":
# FIXME: Investigate why this fails for macOS on PyPI.
@pytest.mark.skip(
sys.platform == "darwin" and not os.getenv("CONDA_PREFIX"),
reason="Fails on MacOS w/ PyPI",
)
# @pytest.mark.skip(
# sys.platform == "darwin" and not os.getenv("CONDA_PREFIX"),
# reason="Fails on MacOS w/ PyPI",
# )
def test_select_hybas_ar_domain_point(self):
point = -114.65, 61.35
dom = self.geoserver.select_hybas_domain(point=point)
Expand Down Expand Up @@ -90,6 +85,7 @@ def test_hydrobasins_upstream_aggregate(self, tmp_path):
)


@pytest.mark.online
class TestHydroRouting:
geoserver = pytest.importorskip("ravenpy.utilities.geoserver")

Expand Down Expand Up @@ -135,6 +131,7 @@ def test_hydro_routing_upstream(self, tmp_path):
assert len(gdf_upstream) == 33 # TODO: Verify this with the model maintainers.


@pytest.mark.online
class TestWFS:
geoserver = pytest.importorskip("ravenpy.utilities.geoserver")

Expand Down Expand Up @@ -174,6 +171,7 @@ def test_get_feature_attributes_wfs(self):
assert gdf.STATE_NAME.unique() == "Nevada"


@pytest.mark.online
class TestWCS:
io = pytest.importorskip("ravenpy.utilities.io")
geoserver = pytest.importorskip("ravenpy.utilities.geoserver")
Expand Down
2 changes: 0 additions & 2 deletions tests/test_parsers.py

This file was deleted.

0 comments on commit f43bea5

Please sign in to comment.