Skip to content

Commit

Permalink
Upgrade all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack authored Dec 16, 2024
1 parent 9c3d1ca commit f58a5a2
Show file tree
Hide file tree
Showing 4 changed files with 680 additions and 688 deletions.
2 changes: 1 addition & 1 deletion adit/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _process_dicom_task(model_label: str, task_id: int) -> ProcessingResult:
logger.info(f"Start processing of {dicom_task}.")
return processor.process()

@concurrent.thread
@concurrent.thread()
def _monitor_task(context: JobContext, future: ProcessFuture) -> None:
while not future.done():
if context.should_abort():
Expand Down
23 changes: 13 additions & 10 deletions adit/dicom_web/tests/utils/test_peekable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@


@pytest.fixture
async def mock_async_iterator() -> AsyncIterator[int]:
yield 1
yield 2
yield 3
def mock_async_iterator():
async def _mock_async_iterator() -> AsyncIterator[int]:
yield 1
yield 2
yield 3

return _mock_async_iterator


@pytest.mark.asyncio
async def test_peek(mock_async_iterator: AsyncIterator[int]) -> None:
peekable = AsyncPeekable(mock_async_iterator)
async def test_peek(mock_async_iterator) -> None:
peekable = AsyncPeekable(mock_async_iterator())
assert await peekable.peek() == 1
assert await peekable.peek() == 1
assert await peekable.__anext__() == 1
assert await peekable.peek() == 2


@pytest.mark.asyncio
async def test_default_value(mock_async_iterator: AsyncIterator[int]) -> None:
peekable = AsyncPeekable(mock_async_iterator)
async def test_default_value(mock_async_iterator) -> None:
peekable = AsyncPeekable(mock_async_iterator())
assert await peekable.peek(42) == 1
assert await peekable.__anext__() == 1
assert await peekable.peek(42) == 2
Expand All @@ -34,8 +37,8 @@ async def test_default_value(mock_async_iterator: AsyncIterator[int]) -> None:


@pytest.mark.asyncio
async def test_empty(mock_async_iterator: AsyncIterator[int]) -> None:
peekable = AsyncPeekable(mock_async_iterator)
async def test_empty(mock_async_iterator) -> None:
peekable = AsyncPeekable(mock_async_iterator())
assert await peekable.peek(42) == 1
assert await peekable.__anext__() == 1
assert await peekable.__anext__() == 2
Expand Down
Loading

0 comments on commit f58a5a2

Please sign in to comment.