예제 #1
0
 def test5(self):
     try:
         print timeout_yield(exc())
         self.assert_(False, "should've raised an exception")
     except:
         pass
     like_yield(wait(1))
예제 #2
0
 def test5(self):
     try:
         print timeout_yield(exc())
         self.assert_(False, "should've raised an exception")
     except:
         pass
     like_yield(wait(1))
예제 #3
0
    def test4(self):
        try:
            print timeout_yield(g(1), timeout=.5)
            self.assert_(False, "should've timed out.")
        except TimeoutError:
            pass

        like_yield(wait(1))
예제 #4
0
    def test4(self):
        try:
            print timeout_yield(g(1), timeout=.5)
            self.assert_(False, "should've timed out." )
        except TimeoutError:
            pass

        like_yield(wait(1)) 
예제 #5
0
 def test3(self):
     self.assert_(timeout_yield(g(.1), timeout=.5) == 6, "should return 6.")
     like_yield(wait(1))
예제 #6
0
 def test2(self):
     self.assert_(
         timeout_yield(f(), timeout=1) == 5,
         "with specified timeout should still return 5")
     like_yield(wait(1))
예제 #7
0
 def test1(self):
     self.assert_(timeout_yield(f()) == 5, "should return 5")
     like_yield(wait(1))
예제 #8
0
def g(t):
    sys.stdout.flush()
    like_yield(wait(t))
    return 6
예제 #9
0
 def test3(self):
     self.assert_( timeout_yield(g(.1), timeout=.5) == 6,
                   "should return 6." )
     like_yield(wait(1))
예제 #10
0
 def test2(self):
     self.assert_(timeout_yield(f(), timeout=1) == 5,
                  "with specified timeout should still return 5" )
     like_yield(wait(1))
예제 #11
0
 def test1(self):
     self.assert_(timeout_yield(f()) == 5, "should return 5" )
     like_yield(wait(1))
예제 #12
0
def g(t):
    sys.stdout.flush()
    like_yield(wait(t))
    return 6