Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb6ac303

Browse files
fix tests
1 parentfce0416 commitb6ac303

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

‎Lib/test/test_asyncio/test_events.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
importunittest
2323
fromunittestimportmock
2424
importweakref
25-
25+
importwarnings
2626
ifsys.platformnotin ('win32','vxworks'):
2727
importtty
2828

@@ -2055,7 +2055,9 @@ def test_remove_fds_after_closing(self):
20552055
classUnixEventLoopTestsMixin(EventLoopTestsMixin):
20562056
defsetUp(self):
20572057
super().setUp()
2058-
watcher=asyncio.SafeChildWatcher()
2058+
withwarnings.catch_warnings():
2059+
warnings.simplefilter('ignore',DeprecationWarning)
2060+
watcher=asyncio.SafeChildWatcher()
20592061
watcher.attach_loop(self.loop)
20602062
asyncio.set_child_watcher(watcher)
20612063

@@ -2652,7 +2654,9 @@ def setUp(self):
26522654
asyncio.set_event_loop(self.loop)
26532655

26542656
ifsys.platform!='win32':
2655-
watcher=asyncio.SafeChildWatcher()
2657+
withwarnings.catch_warnings():
2658+
warnings.simplefilter('ignore',DeprecationWarning)
2659+
watcher=asyncio.SafeChildWatcher()
26562660
watcher.attach_loop(self.loop)
26572661
asyncio.set_child_watcher(watcher)
26582662

‎Lib/test/test_asyncio/test_streams.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
importthreading
1010
importunittest
1111
fromunittestimportmock
12+
importwarnings
1213
fromtest.supportimportsocket_helper
1314
try:
1415
importssl
@@ -791,8 +792,9 @@ def test_read_all_from_pipe_reader(self):
791792
protocol=asyncio.StreamReaderProtocol(reader,loop=self.loop)
792793
transport,_=self.loop.run_until_complete(
793794
self.loop.connect_read_pipe(lambda:protocol,pipe))
794-
795-
watcher=asyncio.SafeChildWatcher()
795+
withwarnings.catch_warnings():
796+
warnings.simplefilter('ignore',DeprecationWarning)
797+
watcher=asyncio.SafeChildWatcher()
796798
watcher.attach_loop(self.loop)
797799
try:
798800
asyncio.set_child_watcher(watcher)

‎Lib/test/test_asyncio/test_unix_events.py‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
importthreading
1313
importunittest
1414
fromunittestimportmock
15+
importwarnings
1516
fromtest.supportimportos_helper
1617
fromtest.supportimportsocket_helper
1718

@@ -1686,12 +1687,16 @@ def test_close(self, m_waitpid):
16861687

16871688
classSafeChildWatcherTests (ChildWatcherTestsMixin,test_utils.TestCase):
16881689
defcreate_watcher(self):
1689-
returnasyncio.SafeChildWatcher()
1690+
withwarnings.catch_warnings():
1691+
warnings.simplefilter("ignore",DeprecationWarning)
1692+
returnasyncio.SafeChildWatcher()
16901693

16911694

16921695
classFastChildWatcherTests (ChildWatcherTestsMixin,test_utils.TestCase):
16931696
defcreate_watcher(self):
1694-
returnasyncio.FastChildWatcher()
1697+
withwarnings.catch_warnings():
1698+
warnings.simplefilter("ignore",DeprecationWarning)
1699+
returnasyncio.FastChildWatcher()
16951700

16961701

16971702
classPolicyTests(unittest.TestCase):
@@ -1724,7 +1729,9 @@ def test_get_default_child_watcher(self):
17241729

17251730
deftest_get_child_watcher_after_set(self):
17261731
policy=self.create_policy()
1727-
watcher=asyncio.FastChildWatcher()
1732+
withwarnings.catch_warnings():
1733+
warnings.simplefilter("ignore",DeprecationWarning)
1734+
watcher=asyncio.FastChildWatcher()
17281735

17291736
policy.set_child_watcher(watcher)
17301737
self.assertIs(policy._watcher,watcher)
@@ -1745,7 +1752,9 @@ def f():
17451752
policy.get_event_loop().close()
17461753

17471754
policy=self.create_policy()
1748-
policy.set_child_watcher(asyncio.SafeChildWatcher())
1755+
withwarnings.catch_warnings():
1756+
warnings.simplefilter("ignore",DeprecationWarning)
1757+
policy.set_child_watcher(asyncio.SafeChildWatcher())
17491758

17501759
th=threading.Thread(target=f)
17511760
th.start()
@@ -1757,7 +1766,9 @@ def test_child_watcher_replace_mainloop_existing(self):
17571766

17581767
# Explicitly setup SafeChildWatcher,
17591768
# default ThreadedChildWatcher has no _loop property
1760-
watcher=asyncio.SafeChildWatcher()
1769+
withwarnings.catch_warnings():
1770+
warnings.simplefilter("ignore",DeprecationWarning)
1771+
watcher=asyncio.SafeChildWatcher()
17611772
policy.set_child_watcher(watcher)
17621773
watcher.attach_loop(loop)
17631774

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp