Create the module and add to sys.modules, then remove it after.
(modname)
| 359 | |
| 360 | @contextlib.contextmanager |
| 361 | def temp_module(modname): |
| 362 | """Create the module and add to sys.modules, then remove it after.""" |
| 363 | assert modname not in sys.modules, (modname,) |
| 364 | with import_helper.isolated_modules(): |
| 365 | yield import_helper.add_module(modname) |
| 366 | |
| 367 | |
| 368 | @contextlib.contextmanager |
no test coverage detected
searching dependent graphs…