We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
test_popen
1 parent 9649278 commit b81d291Copy full SHA for b81d291
Lib/test/test_popen.py
@@ -57,14 +57,17 @@ def test_return_code(self):
57
def test_contextmanager(self):
58
with os.popen("echo hello") as f:
59
self.assertEqual(f.read(), "hello\n")
60
+ self.assertFalse(f.closed)
61
62
def test_iterating(self):
63
64
self.assertEqual(list(f), ["hello\n"])
65
66
67
def test_keywords(self):
- with os.popen(cmd="exit 0", mode="w", buffering=-1):
- pass
68
+ with os.popen(cmd="echo hello", mode="r", buffering=-1) as f:
69
+ self.assertEqual(f.read(), "hello\n")
70
71
72
if __name__ == "__main__":
73
unittest.main()
0 commit comments