From: sobolevn Date: Fri, 10 Jan 2025 10:25:02 +0000 (+0300) Subject: gh-128694: Fix `(env changed)` error in `test_inspect` (#128702) X-Git-Tag: v3.14.0a4~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b484db97b170af0f0e50655c4dcc6b9b1af8e9;p=thirdparty%2FPython%2Fcpython.git gh-128694: Fix `(env changed)` error in `test_inspect` (#128702) --- diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py index 345a57a5cfee..6457bc523de4 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)