Skip to content

Commit

Permalink
disable numba for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Nov 16, 2023
1 parent ad4d6a1 commit 473e087
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

env:
FORCE_COLOR: 3
NUMBA_DISABLE_JIT: "1"

jobs:
pre-commit:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_coverage:
NUMBA_DISABLE_JIT=1 pytest

test_numba:
NUMBA_DISABLE_JIT=0 pytest -rP -m use_numba1
NUMBA_DISABLE_JIT=0 pytest -rP -m use_numba

format:
ruff format $(STYLE_CHECK_FILES)
Expand Down
17 changes: 16 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ def tests(session: nox.Session) -> None:
Run the unit and regular tests.
"""
session.install(".[test]")
session.run("pytest", *session.posargs)

# run tests with numba jit disabled to get real coverage
session.run(
"pytest",
*session.posargs,
env={"NUMBA_DISABLE_JIT": "1"},
)

# run just the numba tests with numba jit enabled
session.run(
"pytest",
"-m",
"use_numba",
*session.posargs,
env={"NUMBA_DISABLE_JIT": "0"},
)


@nox.session(reuse_venv=True)
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ log_cli_level = "INFO"
testpaths = [
"tests",
]

markers = [
"use_numba: mark test functions that call Numba jitted functions",
]

[tool.coverage]
run.source = ["invert4geom"]
Expand Down

0 comments on commit 473e087

Please sign in to comment.