Пример #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')
Пример #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)
Пример #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)
Пример #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')
Пример #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)