Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 def f():
     sleep()
     rlist.append('a')
Esempio n. 4
0
 def f():
     sleep(0.2)
     rlist.append('a')
Esempio n. 5
0
 def _func():
     func(*args, **kwargs)
     sleep(0.0)
Esempio n. 6
0
 def f():
     sleep()
     rlist.append('a')
Esempio n. 7
0
 def f():
     sleep(0.2)
     rlist.append('a')