[Python-checkins] bpo-37224: Improve test__xxsubinterpreters.DestroyTests (GH-18058)

Miss Islington (bot) webhook-mailer at python.org
Tue Feb 4 10:31:24 EST 2020


https://github.com/python/cpython/commit/9a740b6c7e7a88185d79128b8a1993ac387d5091
commit: 9a740b6c7e7a88185d79128b8a1993ac387d5091
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020年02月04日T07:31:19-08:00
summary:
bpo-37224: Improve test__xxsubinterpreters.DestroyTests (GH-18058)
Adds an additional assertion check based on a race condition for `test__xxsubinterpreters.DestroyTests.test_still_running` discovered in the bpo issue.
https://bugs.python.org/issue37224
(cherry picked from commit f03a8f8d5001963ad5b5b28dbd95497e9cc15596)
Co-authored-by: Kyle Stanley <aeros167 at gmail.com>
files:
M Lib/test/test__xxsubinterpreters.py
diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py
index 207b5db5d8fb9..30f8f98acc9dd 100644
--- a/Lib/test/test__xxsubinterpreters.py
+++ b/Lib/test/test__xxsubinterpreters.py
@@ -759,7 +759,11 @@ def test_still_running(self):
 main, = interpreters.list_all()
 interp = interpreters.create()
 with _running(interp):
- with self.assertRaises(RuntimeError):
+ self.assertTrue(interpreters.is_running(interp),
+ msg=f"Interp {interp} should be running before destruction.")
+
+ with self.assertRaises(RuntimeError,
+ msg=f"Should not be able to destroy interp {interp} while it's still running."):
 interpreters.destroy(interp)
 self.assertTrue(interpreters.is_running(interp))
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /