| 84 | sc.done() |
| 85 | |
| 86 | async def test_reload(self, tmp_path, caplog_async): |
| 87 | caplog_async.set_level("INFO") |
| 88 | with taddons.context() as tctx: |
| 89 | f = tmp_path / "foo.py" |
| 90 | f.write_text("\n") |
| 91 | sc = script.Script(str(f), True) |
| 92 | tctx.configure(sc) |
| 93 | await caplog_async.await_log("Loading") |
| 94 | caplog_async.clear() |
| 95 | |
| 96 | for i in range(20): |
| 97 | # Some filesystems only have second-level granularity, |
| 98 | # so just writing once again is not good enough. |
| 99 | f.write_text("\n") |
| 100 | if "Loading" in caplog_async.caplog.text: |
| 101 | break |
| 102 | await asyncio.sleep(0.1) |
| 103 | else: |
| 104 | raise AssertionError("No reload seen") |
| 105 | sc.done() |
| 106 | |
| 107 | async def test_exception(self, tdata, caplog_async): |
| 108 | caplog_async.set_level("INFO") |