Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions 9 Lib/test/test_list.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import signal
import sys
import textwrap
from test import list_tests, support
Expand Down Expand Up @@ -324,8 +325,12 @@ def test_no_memory(self):
_testcapi.set_nomemory(0)
l = [None]
""")
_, _, err = assert_python_failure("-c", code)
self.assertIn("MemoryError", err.decode("utf-8"))
rc, _, _ = assert_python_failure("-c", code)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mark the test with @unittest.skipIf(support.Py_TRACE_REFS, 'cannot test Py_TRACE_REFS build') so that we don't run it under --with-trace-refs?

That's what we do in test_repl's test_no_memory (a different test with the same name).

Along those lines, I'm a bit confused because the PR refers to #118331, but that's a bug report for test_no_memory in test_repl.py not the test_no_memory in test_list.py.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mark the test with @unittest.skipIf(support.Py_TRACE_REFS, 'cannot test Py_TRACE_REFS build') so that we don't run it under --with-trace-refs?

Sure, I have a slight preference for this change since it's testing the thing we care about (not segfaulting) and works in both builds, but that's fine with me.

Along those lines, I'm a bit confused because the PR refers to #118331, but that's a bug report for test_no_memory in test_repl.py not the test_no_memory in test_list.py.

The PR that introduced the failure under tracerefs is linked to that issue so I figured it was fine to link to it as well. I'll create a new issue for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that makes sense. It doesn't need a new issue

if support.MS_WINDOWS:
# STATUS_ACCESS_VIOLATION
self.assertNotEqual(rc, 0xC0000005)
else:
self.assertNotEqual(rc, -int(signal.SIGSEGV))

if __name__ == "__main__":
unittest.main()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.