def test_module(module_name: str) -> Iterator[Error]:
    "Tests a given module's stub against introspecting it at runtime.\n\n    Requires the stub to have been built already, accomplished by a call to ``build_stubs``.\n\n    :param module_name: The module to test\n\n    "
    stub = get_stub(module_name)
    if (stub is None):
        (yield Error([module_name], 'failed to find stubs', MISSING, None))
        return
    try:
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            runtime = importlib.import_module(module_name)
    except Exception as e:
        (yield Error([module_name], 'failed to import: {}'.format(e), stub, MISSING))
        return
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        (yield from verify(stub, runtime, [module_name]))
Tests a given module's stub against introspecting it at runtime.

Requires the stub to have been built already, accomplished by a call to ``build_stubs``.

:param module_name: The module to test
def test_module(module_name: str) -> Iterator[Error]:
    "Tests a given module's stub against introspecting it at runtime.\n\n    Requires the stub to have been built already, accomplished by a call to ``build_stubs``.\n\n    :param module_name: The module to test\n\n    "
    stub = get_stub(module_name)
    if (stub is None):
        (yield Error([module_name], 'failed to find stubs', MISSING, None))
        return
    try:
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
            runtime = importlib.import_module(module_name)
    except Exception as e:
        (yield Error([module_name], 'failed to import: {}'.format(e), stub, MISSING))
        return
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        (yield from verify(stub, runtime, [module_name]))