Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
It seems that np.array may pass on copy=True argument so that the check
assert_called_once_with fails
  • Loading branch information
martin-schlipf committed Feb 25, 2025
1 parent 15d66bf commit ec59a6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/raw/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def mock_read_result(key):
def check_data(actual, key):
mock = mock_read_result(key)
if mock.ndim == 0:
mock.__array__.assert_called_once_with()
mock.__array__.assert_called_once()
assert actual == EXAMPLE_SCALAR
else:
assert isinstance(actual, raw.VaspData)
Expand Down
2 changes: 1 addition & 1 deletion tests/raw/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_scalar_data():
reference = 1
mock = MagicMock()
mock.ndim = 0
mock.__array__ = lambda: np.array(reference)
mock.__array__ = lambda *args, **kwargs: np.array(reference)
vasp = VaspData(mock)
assert vasp == reference
assert np.array(vasp) == reference
Expand Down

0 comments on commit ec59a6a

Please sign in to comment.