bpo-39019: Implement missing __class_getitem__ for subprocess classes (GH-17558)
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 87322c6..2073fd1 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1435,6 +1435,9 @@
subprocess.Popen(['exit', '0'], cwd='/some/nonexistent/directory')
self.assertEqual(c.exception.filename, '/some/nonexistent/directory')
+ def test_class_getitems(self):
+ self.assertIs(subprocess.Popen[bytes], subprocess.Popen)
+ self.assertIs(subprocess.CompletedProcess[str], subprocess.CompletedProcess)
class RunFuncTestCase(BaseTestCase):
def run_python(self, code, **kwargs):