Skip to content

Commit

Permalink
Add test for issue #74
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Dec 20, 2022
1 parent 5e6f504 commit 83ca37c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mcbackend/test_backend_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,28 @@ def test_insert_draw(self):
numpy.testing.assert_array_equal(v3, draw["v3"])
pass

@pytest.mark.xfail(reason="Batch inserting assumes identical dict composition every time. See #74.")
def test_insert_flaky_stats(self):
"""Tries to append stats that only sometimes have an entry for a stat."""
run, chains = fully_initialized(
self.backend,
RunMeta(
sample_stats=[
Variable("always", "int8"),
Variable("sometimes", "bool"),
]
),
)

chain = chains[0]
chain.append({}, dict(always=1, sometimes=True))
chain.append({}, dict(always=2))
chain._commit()

tuple(chain.get_stats("always")) == (1, 2)
assert tuple(chain.get_stats("sometimes")) == (True, None)
pass

def test_get_row_at(self):
run, chains = fully_initialized(
self.backend,
Expand Down

0 comments on commit 83ca37c

Please sign in to comment.