Skip to content
Prev Previous commit
Next Next commit
Fix test: prepare_console() requires events argument
  • Loading branch information
kimimgo committed Mar 19, 2026
commit 853cb8ca3e293b2d6e8373eeab2887505984e95b
8 changes: 4 additions & 4 deletions Lib/test/test_pyrepl/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def test_bow_whitespace_stops_at_whitespace(self):
# GH#146044

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

        # See https://github.com/cpython/issues/146044

Use a link looking like that so that I can click on it in my IDE. I created the link from memory sonjust check that it is the correct URL.

# unix-word-rubout (ctrl-w) should use whitespace boundaries,
# not punctuation boundaries like bow() does
reader = prepare_reader(prepare_console())
reader = prepare_reader(prepare_console([]))
reader.buffer = list("foo.bar baz")
reader.pos = len(reader.buffer) # cursor at end

Expand All @@ -575,7 +575,7 @@ def test_bow_whitespace_stops_at_whitespace(self):

def test_bow_whitespace_includes_punctuation_in_word(self):
# GH#146044
reader = prepare_reader(prepare_console())
reader = prepare_reader(prepare_console([]))
reader.buffer = list("foo.bar(baz) qux")
reader.pos = 12 # cursor after ")"

Expand All @@ -585,7 +585,7 @@ def test_bow_whitespace_includes_punctuation_in_word(self):

def test_bow_stops_at_punctuation(self):
# Verify existing bow() still uses syntax_table (punctuation boundary)
reader = prepare_reader(prepare_console())
reader = prepare_reader(prepare_console([]))
reader.buffer = list("foo.bar baz")
reader.pos = len(reader.buffer)

Expand All @@ -594,7 +594,7 @@ def test_bow_stops_at_punctuation(self):

def test_bow_vs_bow_whitespace_difference(self):
# The key difference: bow() stops at '.', bow_whitespace() does not
reader = prepare_reader(prepare_console())
reader = prepare_reader(prepare_console([]))
reader.buffer = list("foo.bar")
reader.pos = len(reader.buffer)

Expand Down
Loading