summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_unix_events.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-05-30 00:56:33 (GMT)
committerGitHub <noreply@github.com>2018-05-30 00:56:33 (GMT)
commitaf9cda9845666e2f704177a431d29f91efbf828a (patch)
treeecd1b22e6e1a7dad91c5065bfb71ae9dec2bbef5 /Lib/test/test_asyncio/test_unix_events.py
parent3ddee64587482082fcbab930ff82ed67aa9f4a0d (diff)
downloadcpython-af9cda9845666e2f704177a431d29f91efbf828a.zip
cpython-af9cda9845666e2f704177a431d29f91efbf828a.tar.gz
cpython-af9cda9845666e2f704177a431d29f91efbf828a.tar.bz2
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (GH-7233)
This reverts commit 2a7eb0b531656f4a77d85078e6e009e4b3639ef9.
Diffstat (limited to 'Lib/test/test_asyncio/test_unix_events.py')
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 5775668..104f995 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -13,7 +13,6 @@ import sys
import tempfile
import threading
import unittest
-import multiprocessing
from unittest import mock
from test import support
@@ -1793,37 +1792,6 @@ class FastChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
return asyncio.FastChildWatcher()
-class ForkedProcessTests(unittest.TestCase):
- def setUp(self):
- self.parent_loop = asyncio.SelectorEventLoop()
- asyncio.set_event_loop(self.parent_loop)
- self.ctx = multiprocessing.get_context("fork")
-
- def tearDown(self):
- self.parent_loop.close()
-
- def _check_loops_not_equal(self, old_loop):
- loop = asyncio.get_event_loop()
- if loop is old_loop:
- raise RuntimeError("Child process inherited parent's event loop")
-
- try:
- val = loop.run_until_complete(asyncio.sleep(0.05, result=42))
- if val != 42:
- raise RuntimeError("new event loop does not work")
- finally:
- loop.close()
-
- sys.exit(loop is old_loop)
-
- def test_new_loop_in_child(self):
- p = self.ctx.Process(target=self._check_loops_not_equal,
- args=(self.parent_loop,))
- p.start()
- p.join()
- self.assertEqual(p.exitcode, 0)
-
-
class PolicyTests(unittest.TestCase):
def create_policy(self):