From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CF7CF1382C5 for ; Wed, 9 May 2018 14:21:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 15924E0A59; Wed, 9 May 2018 14:21:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E4159E0A59 for ; Wed, 9 May 2018 14:21:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8AAC6335C0C for ; Wed, 9 May 2018 14:21:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9B1C73E for ; Wed, 9 May 2018 14:21:27 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1525875551.3a55ecd1f79c31f477d7bdd0b9f0e97d8a15eb9e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/util/futures/asyncio/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/util/futures/asyncio/test_policy_wrapper_recursion.py X-VCS-Directories: pym/portage/tests/util/futures/asyncio/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 3a55ecd1f79c31f477d7bdd0b9f0e97d8a15eb9e X-VCS-Branch: master Date: Wed, 9 May 2018 14:21:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3ec6a3a4-4a58-4d24-9ae9-64746fd58f96 X-Archives-Hash: e8fd57d6ba88b59ef13c6c15dc814bbc commit: 3a55ecd1f79c31f477d7bdd0b9f0e97d8a15eb9e Author: Zac Medico gentoo org> AuthorDate: Wed May 9 14:19:11 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 9 14:19:11 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3a55ecd1 DefaultEventLoopPolicy: test NotImplementedError due to recursion .../asyncio/test_policy_wrapper_recursion.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pym/portage/tests/util/futures/asyncio/test_policy_wrapper_recursion.py b/pym/portage/tests/util/futures/asyncio/test_policy_wrapper_recursion.py new file mode 100644 index 000000000..d3cd94b35 --- /dev/null +++ b/pym/portage/tests/util/futures/asyncio/test_policy_wrapper_recursion.py @@ -0,0 +1,29 @@ +# Copyright 2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +try: + import asyncio +except ImportError: + asyncio = None + +from portage.tests import TestCase +from portage.util.futures.unix_events import DefaultEventLoopPolicy + + +class PolicyWrapperRecursionTestCase(TestCase): + def testPolicyWrapperRecursion(self): + if asyncio is None: + self.skipTest('asyncio is not available') + + initial_policy = asyncio.get_event_loop_policy() + if not isinstance(initial_policy, DefaultEventLoopPolicy): + asyncio.set_event_loop_policy(DefaultEventLoopPolicy()) + + try: + with self.assertRaises(NotImplementedError): + asyncio.get_event_loop() + + with self.assertRaises(NotImplementedError): + asyncio.get_child_watcher() + finally: + asyncio.set_event_loop_policy(initial_policy)