def test_average_int32_empty(self): scheduler = TestScheduler() msgs = [on_next(150, 1), on_completed(250)] xs = scheduler.create_hot_observable(msgs) res = scheduler.start(create=lambda: xs.pipe(_.average())).messages assert len(res) == 1 assert res[0].value.kind == "E" and res[0].value.exception != None assert res[0].time == 250
def create(): return xs.pipe(_.average(len))