Skip to content

Commit

Permalink
Conversion of 0D numpy objects is now done before add_to_db()
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Jan 25, 2024
1 parent a1f6354 commit 6416ccb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,7 @@ def test_add_to_db(mock_db):
reduced_data = {
"string": "foo",
"scalar": 42,
"np_scalar": np.float32(10),
"zero_dim_array": np.asarray(42),
"float": 31.7,
"image": b'\x89PNG\r\n\x1a\n...' # Not a valid PNG, but good enough for this
}

Expand All @@ -385,8 +384,7 @@ def test_add_to_db(mock_db):

assert row["string"] == reduced_data["string"]
assert row["scalar"] == reduced_data["scalar"]
assert row["np_scalar"] == reduced_data["np_scalar"].item()
assert row["zero_dim_array"] == reduced_data["zero_dim_array"].item()
assert row["float"] == reduced_data["float"]
assert row["image"] == reduced_data["image"]

def test_extractor(mock_ctx, mock_db, mock_run, monkeypatch):
Expand Down

0 comments on commit 6416ccb

Please sign in to comment.