summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAN Long <aisk@users.noreply.github.com>2024-03-18 11:48:50 (GMT)
committerGitHub <noreply@github.com>2024-03-18 11:48:50 (GMT)
commitcd2ed917801b93fb46d1dcf19dd480e5146932d8 (patch)
treec60a9654a99633c5509a9981734bd75e29953381 /Lib/test
parent43c9d6196a8593ebd1fda221a277dccb984e84b6 (diff)
downloadcpython-cd2ed917801b93fb46d1dcf19dd480e5146932d8.zip
cpython-cd2ed917801b93fb46d1dcf19dd480e5146932d8.tar.gz
cpython-cd2ed917801b93fb46d1dcf19dd480e5146932d8.tar.bz2
gh-115538: Emit warning when use bool as fd in _io.WindowsConsoleIO (GH-116925)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_winconsoleio.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_winconsoleio.py b/Lib/test/test_winconsoleio.py
index 209e446..a10d63d 100644
--- a/Lib/test/test_winconsoleio.py
+++ b/Lib/test/test_winconsoleio.py
@@ -43,6 +43,9 @@ class WindowsConsoleIOTests(unittest.TestCase):
self.assertEqual(0, f.fileno())
f.close() # multiple close should not crash
f.close()
+ with self.assertWarns(RuntimeWarning):
+ with ConIO(False):
+ pass
try:
f = ConIO(1, 'w')
@@ -55,6 +58,9 @@ class WindowsConsoleIOTests(unittest.TestCase):
self.assertEqual(1, f.fileno())
f.close()
f.close()
+ with self.assertWarns(RuntimeWarning):
+ with ConIO(False):
+ pass
try:
f = ConIO(2, 'w')