Skip to content

Commit

Permalink
Add test for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Dec 14, 2023
1 parent 14ff564 commit 56a43c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_dftd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_fail() -> None:
"a2": torch.tensor(4.5865),
}

# r4r2 wrong shape
# unsupported element
with pytest.raises(ValueError):
numbers = torch.tensor([1, 105])
dftd3(numbers, positions, param)
Expand Down
7 changes: 5 additions & 2 deletions tests/test_disp.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ def test_fail() -> None:

# wrong numbers
with pytest.raises(ValueError):
numbers = torch.tensor([1])
disp.dispersion(numbers, positions, param, c6)
disp.dispersion(torch.tensor([1]), positions, param, c6)

# unsupported element
with pytest.raises(ValueError):
disp.dispersion(torch.tensor([1, 105]), positions, param, c6)


@pytest.mark.parametrize("dtype", [torch.float, torch.double])
Expand Down

0 comments on commit 56a43c2

Please sign in to comment.