Skip to content

Commit c43b3c0

Browse files
committed
WIP - more suppress of warnings.
1 parent 1b44537 commit c43b3c0

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

Lib/test/_test_multiprocessing.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def test_set_executable(self):
342342
p.join()
343343
self.assertEqual(p.exitcode, 0)
344344

345+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
345346
@support.requires_resource('cpu')
346347
def test_args_argument(self):
347348
# bpo-45735: Using list or tuple as *args* in constructor could
@@ -531,6 +532,7 @@ def _sleep_no_int_handler(cls, event):
531532
def _test_sleep(cls, delay):
532533
time.sleep(delay)
533534

535+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
534536
def _kill_process(self, meth, target=None):
535537
if self.TYPE == 'threads':
536538
self.skipTest('test not appropriate for {}'.format(self.TYPE))
@@ -1554,6 +1556,7 @@ def _test_lock_locked_2processes(cls, lock, event, res):
15541556
res.value = lock.locked()
15551557
event.set()
15561558

1559+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
15571560
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
15581561
def test_lock_locked_2processes(self):
15591562
if self.TYPE != 'processes':
@@ -1640,6 +1643,7 @@ def test_rlock(self):
16401643
self.assertFalse(lock.locked())
16411644
self.assertRaises((AssertionError, RuntimeError), lock.release)
16421645

1646+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
16431647
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
16441648
def test_rlock_locked_2processes(self):
16451649
if self.TYPE != 'processes':
@@ -1938,6 +1942,7 @@ def _test_waitfor_f(cls, cond, state):
19381942
if not result or state.value != 4:
19391943
sys.exit(1)
19401944

1945+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
19411946
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
19421947
def test_waitfor(self):
19431948
# based on test in test/lock_tests.py
@@ -1973,6 +1978,7 @@ def _test_waitfor_timeout_f(cls, cond, state, success, sem):
19731978
if not result and (expected - CLOCK_RES) <= dt:
19741979
success.value = True
19751980

1981+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
19761982
@unittest.skipUnless(HAS_SHAREDCTYPES, 'needs sharedctypes')
19771983
def test_waitfor_timeout(self):
19781984
# based on test in test/lock_tests.py
@@ -2469,7 +2475,7 @@ def _test(cls, values):
24692475
for sv, cv in zip(values, cls.codes_values):
24702476
sv.value = cv[2]
24712477

2472-
2478+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
24732479
def test_value(self, raw=False):
24742480
if raw:
24752481
values = [self.RawValue(code, value)
@@ -2533,6 +2539,7 @@ def f(cls, seq):
25332539
for i in range(1, len(seq)):
25342540
seq[i] += seq[i-1]
25352541

2542+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
25362543
@unittest.skipIf(c_int is None, "requires _ctypes")
25372544
def test_array(self, raw=False):
25382545
seq = [680, 626, 934, 821, 150, 233, 548, 982, 714, 831]
@@ -4351,6 +4358,7 @@ def _double(cls, x, y, z, foo, arr, string):
43514358
for i in range(len(arr)):
43524359
arr[i] *= 2
43534360

4361+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
43544362
def test_sharedctypes(self, lock=False):
43554363
x = Value('i', 7, lock=lock)
43564364
y = Value(c_double, 1.0/3.0, lock=lock)
@@ -5584,6 +5592,7 @@ def signal_and_sleep(cls, sem, period):
55845592
sem.release()
55855593
time.sleep(period)
55865594

5595+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
55875596
@support.requires_resource('walltime')
55885597
def test_wait_integer(self):
55895598
from multiprocessing.connection import wait
@@ -6010,6 +6019,7 @@ def test_preload_resources(self):
60106019
print(err)
60116020
self.fail("failed spawning forkserver or grandchild")
60126021

6022+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
60136023
@unittest.skipIf(sys.platform == "win32",
60146024
"Only Spawn on windows so no risk of mixing")
60156025
@only_run_in_spawn_testsuite("avoids redundant testing.")

Lib/test/test_kqueue.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import time
1010
import unittest
1111

12+
from test.support import warnings_helper
13+
1214
if not hasattr(select, "kqueue"):
1315
raise unittest.SkipTest("test works only on BSD")
1416

@@ -257,6 +259,7 @@ def test_fd_non_inheritable(self):
257259
self.addCleanup(kqueue.close)
258260
self.assertEqual(os.get_inheritable(kqueue.fileno()), False)
259261

262+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
260263
@support.requires_fork()
261264
def test_fork(self):
262265
# gh-110395: kqueue objects must be closed after fork

Lib/test/test_platform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from unittest import mock
1212

1313
from test import support
14-
from test.support import os_helper
14+
from test.support import os_helper, warnings_helper
1515

1616
try:
1717
# Some of the iOS tests need ctypes to operate.
@@ -465,7 +465,7 @@ def test_mac_ver(self):
465465
else:
466466
self.assertEqual(res[2], 'PowerPC')
467467

468-
468+
@warnings_helper.ignore_warnings(category=DeprecationWarning) # gh-135427
469469
@unittest.skipUnless(sys.platform == 'darwin', "OSX only test")
470470
def test_mac_ver_with_fork(self):
471471
# Issue7895: platform.mac_ver() crashes when using fork without exec

0 commit comments

Comments
 (0)