call site 1 for test.raises
c-extension/greenlet/test_throw.py - line 75
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
   def test_throw_goes_to_original_parent():
       main = greenlet.getcurrent()
       def f1():
           try:
               main.switch("f1 ready to catch")
           except IndexError:
               return "caught"
           else:
               return "normal exit"
       def f2():
           main.switch("from f2")
   
       g1 = greenlet(f1)
       g2 = greenlet(f2, parent=g1)
->     py.test.raises(IndexError, g2.throw, IndexError)
       assert g2.dead
       assert g1.dead
   
       g1 = greenlet(f1)
       g2 = greenlet(f2, parent=g1)
       res = g1.switch()
       assert res == "f1 ready to catch"
       res = g2.throw(IndexError)
       assert res == "caught"
       assert g2.dead
       assert g1.dead
   
       g1 = greenlet(f1)
       g2 = greenlet(f2, parent=g1)
       res = g1.switch()
       assert res == "f1 ready to catch"
       res = g2.switch()
       assert res == "from f2"
       res = g2.throw(IndexError)
       assert res == "caught"
       assert g2.dead
       assert g1.dead