Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 committed Jan 20, 2023
1 parent e283640 commit db4ecb5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/flytekit/unit/remote/test_lazy_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,16 @@ def _getter():
e.compile(ctx)
assert e._entity is not None
assert e.entity == dummy_task


def test_lazy_loading_exception():
def _getter():
raise AttributeError("Error")

e = LazyEntity("x", _getter)
assert e.name == "x"
assert e._entity is None
with pytest.raises(RuntimeError) as exc:
assert e.blah

assert isinstance(exc.value.__cause__, AttributeError)

0 comments on commit db4ecb5

Please sign in to comment.