Пример #1
0
 def test_simple_sleep(self):
     if IS_TRAVIS:
         skip()
     start = time.time()
     sleep(0.02)
     delay = time.time() - start
     assert 0.02 - 0.004 <= delay < 0.02 + 0.02, delay
Пример #2
0
    def test_simple(self):
        r_list = []
        def f():
            r_list.append(True)

        pid = spawn(f)
        assert isinstance(pid, ActorRef)
        assert pid.ref == 0
        assert hasattr(pid.actor, 'mailbox')

        sleep(0.1)
        core.run()

        assert r_list == [True]
        assert pid.actor is None
        assert pid.is_alive is False
Пример #3
0
 def f():
     sleep()
     rlist.append('a')
Пример #4
0
 def f():
     sleep(0.2)
     rlist.append('a')
Пример #5
0
 def _func():
     func(*args, **kwargs)
     sleep(0.0)
Пример #6
0
 def f():
     sleep()
     rlist.append('a')
Пример #7
0
 def f():
     sleep(0.2)
     rlist.append('a')