mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-46425: fix direct invocation of asyncio
tests (#30725)
This commit is contained in:
parent
38afeb1a33
commit
5a5340044c
6 changed files with 25 additions and 2 deletions
|
@ -32,3 +32,7 @@ class DecimalContextTest(unittest.TestCase):
|
|||
|
||||
self.assertEqual(str(r2[0]), '0.333333')
|
||||
self.assertEqual(str(r2[1]), '0.111111')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -16,3 +16,7 @@ class FutureTests(unittest.IsolatedAsyncioTestCase):
|
|||
# The check for returned string is not very reliable but
|
||||
# exact comparison for the whole string is even weaker.
|
||||
self.assertIn('...', repr(await asyncio.wait_for(func(), timeout=10)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -55,3 +55,7 @@ class ProtocolsAbsTests(unittest.TestCase):
|
|||
self.assertIsNone(sp.pipe_connection_lost(1, f))
|
||||
self.assertIsNone(sp.process_exited())
|
||||
self.assertFalse(hasattr(sp, '__dict__'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -2,7 +2,7 @@ import asyncio
|
|||
import unittest
|
||||
|
||||
from unittest import mock
|
||||
from . import utils as test_utils
|
||||
from test.test_asyncio import utils as test_utils
|
||||
|
||||
|
||||
class TestPolicy(asyncio.AbstractEventLoopPolicy):
|
||||
|
@ -180,3 +180,7 @@ class RunTests(BaseTest):
|
|||
|
||||
self.assertIsNone(spinner.ag_frame)
|
||||
self.assertFalse(spinner.ag_running)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -565,3 +565,7 @@ else:
|
|||
|
||||
def create_event_loop(self):
|
||||
return asyncio.SelectorEventLoop(selectors.SelectSelector())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import socket
|
||||
import time
|
||||
import asyncio
|
||||
import sys
|
||||
import unittest
|
||||
|
@ -512,3 +511,7 @@ else:
|
|||
|
||||
def create_event_loop(self):
|
||||
return asyncio.SelectorEventLoop(selectors.SelectSelector())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue