From 6a8c41b328d9488f35d54157f458f5ac24ce6983 Mon Sep 17 00:00:00 2001 From: Bruno Domingues Date: Tue, 4 Aug 2026 15:21:14 -0300 Subject: [PATCH] fix(pytest): Workaround unraisableexception plugin crash Disables the unraisableexception plugin in pytest due to a known bug in pytest>=9.1 where it crashes with tracemalloc errors when multiple unraisable exceptions occur close together. --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a878882..db08645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,6 +116,12 @@ python_functions = ["test_*"] addopts = [ "-v", "--strict-markers", + # pytest>=9.1 has a known bug where its unraisableexception plugin crashes + # (tracemalloc partially-initialized AttributeError) when 2+ unraisable + # exceptions land close together — e.g. "coroutine was never awaited" from + # AsyncMock-mocked sync methods (metrics_controller, minio_repository) being + # GC'd. Harmless mock artifacts turned into a hard ERROR by the plugin itself. + "-p", "no:unraisableexception", ] markers = [ "asyncio: marks tests as async",