Skip to content

Commit 8955136

Browse files
committed
WIP - more suppressing of warnings
1 parent 6308e19 commit 8955136

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Lib/test/test_concurrent_futures/util.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from test import support
1313
from test.support import threading_helper
14+
import warnings
1415

1516

1617
def create_future(state=PENDING, exception=None, result=None):
@@ -51,7 +52,15 @@ def setUp(self):
5152
max_workers=self.worker_count,
5253
mp_context=self.get_context(),
5354
**self.executor_kwargs)
54-
self.manager = self.get_context().Manager()
55+
# gh-135427
56+
# In some of the tests, a forked child forks another child of itself. In that case, using
57+
# warnings_helper.ignore_warnings decorator does not actually ignore the warning from that
58+
# child of child, and a warnings_helper.ignore_warnings exception is raised.
59+
with warnings.catch_warnings():
60+
warnings.filterwarnings('ignore',
61+
message=".*fork.*may lead to deadlocks in the child.*",
62+
category=DeprecationWarning)
63+
self.manager = self.get_context().Manager()
5564
else:
5665
self.executor = self.executor_type(
5766
max_workers=self.worker_count,

Lib/test/test_logging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ def remove_loop(fname, tries):
730730
# based on os.fork existing because that is what users and this test use.
731731
# This helps ensure that when fork exists (the important concept) that the
732732
# register_at_fork mechanism is also present and used.
733+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
733734
@support.requires_fork()
734735
@threading_helper.requires_working_threading()
735736
@skip_if_asan_fork
@@ -4067,6 +4068,7 @@ def test_config_reject_simple_queue_handler_multiprocessing_context(self):
40674068
with self.assertRaises(ValueError):
40684069
self._apply_simple_queue_listener_configuration(qspec)
40694070

4071+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
40704072
@skip_if_tsan_fork
40714073
@support.requires_subprocess()
40724074
@unittest.skipUnless(support.Py_DEBUG, "requires a debug build for testing"

0 commit comments

Comments
 (0)