()
| 4 | |
| 5 | |
| 6 | def test_setTimeout_unref(): |
| 7 | async def async_fn(): |
| 8 | obj = {'val': 0} |
| 9 | pm.eval("""(obj) => { |
| 10 | setTimeout(()=>{ obj.val = 2 }, 1000).ref().ref().unref().ref().unref().unref(); |
| 11 | // chaining, no use on the first two ref calls since it's already refed initially |
| 12 | setTimeout(()=>{ obj.val = 1 }, 100); |
| 13 | }""")(obj) |
| 14 | await pm.wait() # we shouldn't wait until the first timer is fired since it's currently unrefed |
| 15 | assert obj['val'] == 1 |
| 16 | |
| 17 | # making sure the async_fn is run |
| 18 | return True |
| 19 | assert asyncio.run(async_fn()) |
| 20 | |
| 21 | |
| 22 | def test_setInterval_unref(): |
nothing calls this directly
no test coverage detected