()
| 28 | partial_module = "partial" |
| 29 | complete_module = "complete" |
| 30 | def importer(): |
| 31 | imp.acquire_lock() |
| 32 | sys.modules[fake_module_name] = partial_module |
| 33 | import_started.set() |
| 34 | time.sleep(0.01) # Give the other thread time to try and acquire. |
| 35 | sys.modules[fake_module_name] = complete_module |
| 36 | imp.release_lock() |
| 37 | t = threading.Thread(target=importer) |
| 38 | t.start() |
| 39 | import_started.wait() |
no test coverage detected