async def test_eval_wlsymbol(self):
     start = time.perf_counter()
     task = asyncio.create_task(
         self.async_session.evaluate(
             wl.CompoundExpression(wl.Pause(0.1), wl.Range(2))))
     timer = time.perf_counter() - start
     self.assertTrue(timer < 0.1)
     res = await task
     numpy.assert_array_equal(res, numpy.arange(1, 3))
Exemplo n.º 2
0
 async def test_eval_wlsymbol(self):
     start = time.perf_counter()
     task = asyncio.create_task(
         self.async_session.evaluate(
             wl.CompoundExpression(wl.Pause(.1), wl.Range(2))))
     timer = time.perf_counter() - start
     self.assertTrue(timer < .1)
     res = await task
     self.assertEqual(res, [1, 2])
 def send_lines(self, *lines):
     if len(lines) == 1:
         return self.send_side_effect(wl.Print(*lines))
     elif lines:
         return self.send_side_effect(
             wl.CompoundExpression(*map(wl.Print, lines)))