Ruff (in our unpinned tests) flags a new warning:
error[ASYNC119]: Yield in context manager in async generator may not trigger cleanup
--> src/labthings_fastapi/outputs/mjpeg_stream.py:292:21
|
290 | i = await self.next_frame()
291 | async with self.buffer_for_reading(i) as frame:
292 | yield frame
| ^^^^^^^^^^^
293 | except StopAsyncIteration:
294 | break
|
help: Use `@asynccontextmanager` if appropriate, or refactor
This is not an @asynccontextmanager and shouldn't be: I guess it probably is the case that we may want to consider refactoring.
To be honest, the buffer-retention mechanism doesn't serve much purpose so we might be better off just simplifying the stream code, but either way it probably wants looking at.
Ruff (in our unpinned tests) flags a new warning:
This is not an
@asynccontextmanagerand shouldn't be: I guess it probably is the case that we may want to consider refactoring.To be honest, the buffer-retention mechanism doesn't serve much purpose so we might be better off just simplifying the stream code, but either way it probably wants looking at.