diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-12-04 12:50:46 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-04 12:50:46 (GMT) |
| commit | 7aa87bba056c9c548812a82cefbd122c67c71b88 (patch) | |
| tree | 8c4d9cd91198be2cc4ee375795b0dad6c5a708ef /Lib/test/test_capi/test_misc.py | |
| parent | 9e38553132bf7c6fc13e9f268a54ac6533e6ad41 (diff) | |
| download | cpython-7aa87bba056c9c548812a82cefbd122c67c71b88.zip cpython-7aa87bba056c9c548812a82cefbd122c67c71b88.tar.gz cpython-7aa87bba056c9c548812a82cefbd122c67c71b88.tar.bz2 | |
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
Unless we explicitly test non-bool values.
(cherry picked from commit 76f43fc09af29401cc0cec7710b03e4dbf8a4578)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_capi/test_misc.py')
| -rw-r--r-- | Lib/test/test_capi/test_misc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index b30b8d1..6cda916 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -139,8 +139,9 @@ class CAPITest(unittest.TestCase): class Z(object): def __len__(self): return 1 - self.assertRaises(TypeError, _posixsubprocess.fork_exec, - 1,Z(),3,(1, 2),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) + with self.assertRaisesRegex(TypeError, 'indexing'): + _posixsubprocess.fork_exec( + 1,Z(),True,(1, 2),5,6,7,8,9,10,11,12,13,14,True,True,17,False,19,20,21,22,False) # Issue #15736: overflow in _PySequence_BytesToCharpArray() class Z(object): def __len__(self): @@ -148,7 +149,7 @@ class CAPITest(unittest.TestCase): def __getitem__(self, i): return b'x' self.assertRaises(MemoryError, _posixsubprocess.fork_exec, - 1,Z(),3,(1, 2),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) + 1,Z(),True,(1, 2),5,6,7,8,9,10,11,12,13,14,True,True,17,False,19,20,21,22,False) @unittest.skipUnless(_posixsubprocess, '_posixsubprocess required for this test.') def test_subprocess_fork_exec(self): @@ -158,7 +159,7 @@ class CAPITest(unittest.TestCase): # Issue #15738: crash in subprocess_fork_exec() self.assertRaises(TypeError, _posixsubprocess.fork_exec, - Z(),[b'1'],3,(1, 2),5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23) + Z(),[b'1'],True,(1, 2),5,6,7,8,9,10,11,12,13,14,True,True,17,False,19,20,21,22,False) @unittest.skipIf(MISSING_C_DOCSTRINGS, "Signature information for builtins requires docstrings") |
