We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b23e2d commit 7cd1469Copy full SHA for 7cd1469
Lib/test/test_interpreters/test_object_proxy.py
@@ -273,6 +273,20 @@ def __del__(self):
273
274
self.assertTrue(called)
275
276
+ def test_called_in_correct_interpreter(self):
277
+ called = False
278
+
279
+ def foo():
280
+ nonlocal called
281
+ self.assertEqual(interpreters.get_current(), interpreters.get_main())
282
+ called = True
283
284
+ proxy = share(foo)
285
+ with self.create_interp(proxy=proxy) as interp:
286
+ interp.exec("proxy()")
287
288
+ self.assertTrue(called)
289
290
291
if __name__ == "__main__":
292
unittest.main()
0 commit comments