Skip to content

Commit 1b44537

Browse files
committed
WIP - adding more suppressing of the DeprecatinoWarning
1 parent 204c642 commit 1b44537

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lib/test/test_concurrent_futures/executor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_map_exception(self):
7777
with self.assertRaises(ZeroDivisionError):
7878
i.__next__()
7979

80+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
8081
@support.requires_resource('walltime')
8182
def test_map_timeout(self):
8283
results = []
@@ -135,6 +136,7 @@ def test_map_buffersize_on_infinite_iterable(self):
135136
self.assertEqual(next(res, None), "1")
136137
self.assertEqual(next(res, None), "2")
137138

139+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
138140
def test_map_buffersize_on_multiple_infinite_iterables(self):
139141
res = self.executor.map(
140142
add,

Lib/test/test_concurrent_futures/test_wait.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import unittest
44
from concurrent import futures
55
from test import support
6-
from test.support import threading_helper
6+
from test.support import threading_helper, warnings_helper
77

88
from .util import (
99
CANCELLED_FUTURE, CANCELLED_AND_NOTIFIED_FUTURE, EXCEPTION_FUTURE,
@@ -22,6 +22,7 @@ def wait_and_raise(e):
2222

2323

2424
class WaitTests:
25+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
2526
def test_20369(self):
2627
# See https://bugs.python.org/issue20369
2728
future = self.executor.submit(mul, 1, 2)
@@ -30,7 +31,7 @@ def test_20369(self):
3031
self.assertEqual({future}, done)
3132
self.assertEqual(set(), not_done)
3233

33-
34+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
3435
def test_first_completed(self):
3536
event = self.create_event()
3637
future1 = self.executor.submit(mul, 21, 2)
@@ -47,6 +48,7 @@ def test_first_completed(self):
4748
event.set()
4849
future2.result() # wait for job to finish
4950

51+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
5052
def test_first_completed_some_already_completed(self):
5153
event = self.create_event()
5254
future1 = self.executor.submit(event.wait)
@@ -64,6 +66,7 @@ def test_first_completed_some_already_completed(self):
6466
event.set()
6567
future1.result() # wait for job to finish
6668

69+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
6770
def test_first_exception(self):
6871
event1 = self.create_event()
6972
event2 = self.create_event()
@@ -93,6 +96,7 @@ def wait_for_future1():
9396
event2.set()
9497
future3.result() # wait for job to finish
9598

99+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
96100
def test_first_exception_some_already_complete(self):
97101
event = self.create_event()
98102
future1 = self.executor.submit(divmod, 21, 0)
@@ -114,6 +118,7 @@ def test_first_exception_some_already_complete(self):
114118
event.set()
115119
future2.result() # wait for job to finish
116120

121+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
117122
def test_first_exception_one_already_failed(self):
118123
event = self.create_event()
119124
future1 = self.executor.submit(event.wait)
@@ -129,6 +134,7 @@ def test_first_exception_one_already_failed(self):
129134
event.set()
130135
future1.result() # wait for job to finish
131136

137+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
132138
def test_all_completed(self):
133139
future1 = self.executor.submit(divmod, 2, 0)
134140
future2 = self.executor.submit(mul, 2, 21)
@@ -148,6 +154,7 @@ def test_all_completed(self):
148154
future2]), finished)
149155
self.assertEqual(set(), pending)
150156

157+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
151158
def test_timeout(self):
152159
short_timeout = 0.050
153160

Lib/test/test_logging.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4046,6 +4046,7 @@ def test_config_queue_handler_invalid_config_does_not_create_multiprocessing_man
40464046
self._apply_simple_queue_listener_configuration(qspec)
40474047
manager.assert_not_called()
40484048

4049+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
40494050
@skip_if_tsan_fork
40504051
@support.requires_subprocess()
40514052
@unittest.skipUnless(support.Py_DEBUG, "requires a debug build for testing"
@@ -4109,6 +4110,7 @@ def _mpinit_issue121723(qspec, message_to_log):
41094110
# log a message (this creates a record put in the queue)
41104111
logging.getLogger().info(message_to_log)
41114112

4113+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
41124114
@skip_if_tsan_fork
41134115
@support.requires_subprocess()
41144116
def test_multiprocessing_queues(self):
@@ -5339,6 +5341,7 @@ def _extract_logrecord_process_name(key, logMultiprocessing, conn=None):
53395341
else:
53405342
return results
53415343

5344+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
53425345
@skip_if_tsan_fork
53435346
def test_multiprocessing(self):
53445347
support.skip_if_broken_multiprocessing_synchronize()

0 commit comments

Comments
 (0)