def test_range_double_subscribe(self): scheduler = TestScheduler() obs = reactivex.range(1, 4) results = scheduler.start(lambda: obs.pipe(ops.concat(obs))) assert results.messages == [ on_next(200, 1), on_next(200, 2), on_next(200, 3), on_next(200, 1), on_next(200, 2), on_next(200, 3), on_completed(200), ]
def create(): return reactivex.range(0, 10, 2)
def create(): return reactivex.range(5)
def create(): return reactivex.range(-10, 5)
def create(): return reactivex.range(10, 15)
def test_run_range_to_iterable(self): result = reactivex.range(42).pipe(ops.to_iterable()).run() assert list(result) == list(range(42))
def test_run_range(self): result = reactivex.range(42).run() assert result == 41
async def go(loop): scheduler = AsyncIOScheduler(loop) ai = reactivex.range(0, 10, scheduler=scheduler).pipe(to_async_iterable()) async for x in ai: print("got %s" % x)