Skip to content

Commit

Permalink
Add extra tests to pass patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rose Yemelyanova committed Sep 14, 2023
1 parent 3ad5eda commit 1c5bd44
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/core/_device/test_device_collector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from ophyd_async.core import Device, DeviceCollector
import pytest

class Dummy(Device):
def connect(self, sim: bool = False):
raise AttributeError()

def test_device_collector_propagates_error(RE):
with pytest.raises(AttributeError):
with DeviceCollector():
dummy = Dummy("somename")
6 changes: 6 additions & 0 deletions tests/core/test_async_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,9 @@ async def test_status_propogates_traceback_under_RE(RE) -> None:
assert expected_call_stack == [
x.name for x in traceback.extract_tb(exception.__traceback__)
]


async def test_async_status_exception_timeout():
st = AsyncStatus(asyncio.sleep(0.1))
with pytest.raises(Exception):
st.exception(timeout=1.0)

0 comments on commit 1c5bd44

Please sign in to comment.