Skip to content

Commit 60d200e

Browse files
committed
fix: address comments
Signed-off-by: yihong0618 <[email protected]>
1 parent 2e2e467 commit 60d200e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_atexit.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def test_atexit_with_low_memory(self):
202202
203203
def callback():
204204
print("hello")
205-
pass
206205
207206
atexit.register(callback)
208207
# Simulate low memory condition
@@ -212,10 +211,13 @@ def callback():
212211
with script_helper.spawn_python('-c', user_input,
213212
stderr=subprocess.PIPE) as p:
214213
p.wait()
215-
output = p.stdout.read()
214+
stdout = p.stdout.read()
215+
stderr = p.stderr.read()
216216

217217
self.assertIn(p.returncode, (0, 1))
218-
self.assertNotIn(b"hello", output)
218+
self.assertNotIn(b"hello", stdout)
219+
# MemoryError should appear in stderr
220+
self.assertIn(b"MemoryError", stderr)
219221

220222

221223
if __name__ == "__main__":

0 commit comments

Comments
 (0)