File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,30 @@ def test_insert_draw(self):
271271 numpy .testing .assert_array_equal (v3 , draw ["v3" ])
272272 pass
273273
274+ @pytest .mark .xfail (
275+ reason = "Batch inserting assumes identical dict composition every time. See #74."
276+ )
277+ def test_insert_flaky_stats (self ):
278+ """Tries to append stats that only sometimes have an entry for a stat."""
279+ run , chains = fully_initialized (
280+ self .backend ,
281+ RunMeta (
282+ sample_stats = [
283+ Variable ("always" , "int8" ),
284+ Variable ("sometimes" , "bool" ),
285+ ]
286+ ),
287+ )
288+
289+ chain = chains [0 ]
290+ chain .append ({}, dict (always = 1 , sometimes = True ))
291+ chain .append ({}, dict (always = 2 ))
292+ chain ._commit ()
293+
294+ tuple (chain .get_stats ("always" )) == (1 , 2 )
295+ assert tuple (chain .get_stats ("sometimes" )) == (True , None )
296+ pass
297+
274298 def test_get_row_at (self ):
275299 run , chains = fully_initialized (
276300 self .backend ,
You can’t perform that action at this time.
0 commit comments