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.
1 parent 2e2e467 commit 60d200eCopy full SHA for 60d200e
Lib/test/test_atexit.py
@@ -202,7 +202,6 @@ def test_atexit_with_low_memory(self):
202
203
def callback():
204
print("hello")
205
- pass
206
207
atexit.register(callback)
208
# Simulate low memory condition
@@ -212,10 +211,13 @@ def callback():
212
211
with script_helper.spawn_python('-c', user_input,
213
stderr=subprocess.PIPE) as p:
214
p.wait()
215
- output = p.stdout.read()
+ stdout = p.stdout.read()
+ stderr = p.stderr.read()
216
217
self.assertIn(p.returncode, (0, 1))
218
- self.assertNotIn(b"hello", output)
+ self.assertNotIn(b"hello", stdout)
219
+ # MemoryError should appear in stderr
220
+ self.assertIn(b"MemoryError", stderr)
221
222
223
if __name__ == "__main__":
0 commit comments