gh-106152 generator.throw() should trigger a call in cProfile
(self)
| 122 | pr.disable() |
| 123 | |
| 124 | def test_throw(self): |
| 125 | """ |
| 126 | gh-106152 |
| 127 | generator.throw() should trigger a call in cProfile |
| 128 | """ |
| 129 | |
| 130 | def gen(): |
| 131 | yield |
| 132 | |
| 133 | pr = self.profilerclass() |
| 134 | pr.enable() |
| 135 | g = gen() |
| 136 | try: |
| 137 | g.throw(SyntaxError) |
| 138 | except SyntaxError: |
| 139 | pass |
| 140 | pr.disable() |
| 141 | pr.create_stats() |
| 142 | |
| 143 | self.assertTrue(any("throw" in func[2] for func in pr.stats.keys())), |
| 144 | |
| 145 | def test_bad_descriptor(self): |
| 146 | # gh-132250 |
nothing calls this directly
no test coverage detected