Example #1
0
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')
Example #2
0
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)
Example #3
0
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)
Example #4
0
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')
Example #5
0
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)