aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorKumar Aditya <rahuladitya303@gmail.com>2021-12-09 18:46:45 +0530
committerGitHub <noreply@github.com>2021-12-09 13:16:45 +0000
commitaf6b4068859a5d0c8afd696f3c0c0155660211a4 (patch)
tree51c7e19fc4f539e345c1464175af5abe7fbcd7e3 /Lib/test/_test_multiprocessing.py
parente2cfc89e099b8fad5d8d5bd7f59dadffb6078778 (diff)
downloadcpython-af6b4068859a5d0c8afd696f3c0c0155660211a4.tar.gz
cpython-af6b4068859a5d0c8afd696f3c0c0155660211a4.zip
bpo-25066: Added repr for multiprocessing.Event (GH-29749)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 3bc5b8f3d79..b2d656ab428 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -1645,7 +1645,20 @@ class _TestEvent(BaseTestCase):
self.assertEqual(wait(), True)
p.join()
-#
+ def test_repr(self) -> None:
+ event = self.Event()
+ if self.TYPE == 'processes':
+ self.assertRegex(repr(event), r"<Event at .* unset>")
+ event.set()
+ self.assertRegex(repr(event), r"<Event at .* set>")
+ event.clear()
+ self.assertRegex(repr(event), r"<Event at .* unset>")
+ elif self.TYPE == 'manager':
+ self.assertRegex(repr(event), r"<EventProxy object, typeid 'Event' at .*")
+ event.set()
+ self.assertRegex(repr(event), r"<EventProxy object, typeid 'Event' at .*")
+
+
# Tests for Barrier - adapted from tests in test/lock_tests.py
#