Skip to content

Commit

Permalink
add missing load tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Nov 11, 2024
1 parent e83b684 commit 3cb4ef9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ def test_attrs():
)


def test_load():
assert load("tests.targets.fn_module.bar") is not None
assert load("tests.targets.fn_module:bar") is not None
with pytest.raises(ValueError):
assert load("tests.targets.fn_module.bar", allow_splits=":") is not None
with pytest.raises(AttributeError):
assert load("tests.targets.fn_module:bar", allow_splits=".") is not None


def test_load_any():
assert load_any("tests.targets.fn_module", ["not_existing", "bar"]) is not None
with pytest.warns(DeprecationWarning) as records:
Expand Down

0 comments on commit 3cb4ef9

Please sign in to comment.