Example #1
0
def test_optional_import():
    has_pytest, pyt = optional_import('pytest')
    assert has_pytest
    assert pyt == pytest
Example #2
0
def test_optional_import_nonexisting():
    has_nonex, nonex = optional_import('clearlynonexistingpackage')
    assert not has_nonex
    assert nonex is None