Provoke early SSL transport ResourceWarnings if they are expected
import asyncio
import dataclasses
+import gc
import warnings
import pyngrok.conf
@@ -31,6 +32,10 @@ def no_serverside_resource_warnings():
message='unclosed transport')
yield
+ # Provoke the garbage collection of SSL sockets to trigger the warnings.
+ # Otherwise, in PyPy, these warnings leak to other tests due to delayed gc.
+ gc.collect()
+
# TODO: LATER: Fix this issue after aiohttp 4.0.0 is used.
@pytest.fixture()
