mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)
Unless we explicitly test non-bool values.
This commit is contained in:
parent
bf26bdf6ac
commit
76f43fc09a
5 changed files with 9 additions and 8 deletions
|
@ -138,8 +138,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):
|
||||
|
@ -147,7 +148,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):
|
||||
|
@ -157,7 +158,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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue