Skip to content

Commit

Permalink
Some more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
maroba committed Dec 20, 2024
1 parent a703879 commit 73903eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 0 additions & 4 deletions tests/test_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,3 @@ def compute_errs(acc, plot=False):
def loglog_slope(x, y):
slope, intercept = np.polyfit(np.log(x), np.log(y), 1)
return slope


if __name__ == "__main__":
test_iterative_accuracy()
16 changes: 15 additions & 1 deletion tests/test_grid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from findiff.grids import EquidistantAxis
from findiff.grids import EquidistantAxis, make_grid, make_axis


def test_create_equidistantaxis():
Expand All @@ -23,3 +23,17 @@ def test_create_equidistantaxis_fails_invalid_args():

with pytest.raises(ValueError, match="Dimension must be an integer"):
EquidistantAxis(0.1, 1)


def test_makegrid_with_none_returns_none():
assert make_grid(None) is None


def test_makegrid_with_invalid_arg_raises_exception():
with pytest.raises(TypeError):
make_grid("sndljas")


def test_makeaxis_with_gridaxis_returns_axis():
axis = EquidistantAxis(1, 1)
assert make_axis(1, axis) is axis

0 comments on commit 73903eb

Please sign in to comment.