From 65b484db97b170af0f0e50655c4dcc6b9b1af8e9 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Fri, 10 Jan 2025 13:25:02 +0300 Subject: gh-128694: Fix `(env changed)` error in `test_inspect` (#128702) --- Lib/test/test_inspect/test_inspect.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py index 345a57a..6457bc5 100644 --- a/Lib/test/test_inspect/test_inspect.py +++ b/Lib/test/test_inspect/test_inspect.py @@ -1,4 +1,5 @@ from annotationlib import Format, ForwardRef +import asyncio import builtins import collections import copy @@ -2791,6 +2792,10 @@ class TestGetAsyncGenState(unittest.IsolatedAsyncioTestCase): async def asyncTearDown(self): await self.asyncgen.aclose() + @classmethod + def tearDownClass(cls): + asyncio._set_event_loop_policy(None) + def _asyncgenstate(self): return inspect.getasyncgenstate(self.asyncgen) -- cgit v0.12