def test_module_is_imported_uses_caller_globals_by_default(): assert module_is_imported('pytest') assert not module_is_imported('pkgutil') assert not module_is_imported('does_not_even_exist')
def test_module_is_imported(): globs = globals() assert module_is_imported('pytest', scope=globs) assert not module_is_imported('pkgutil', scope=globs) assert not module_is_imported('does_not_even_exist', scope=globs)
def test_module_is_imported(): globs = globals() assert module_is_imported("pytest", scope=globs) assert not module_is_imported("pkgutil", scope=globs) assert not module_is_imported("does_not_even_exist", scope=globs)