Skip to content
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
10 changes: 10 additions & 0 deletions bpython/test/test_crashers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def next(self):
self.data = self.data[index + 4 :]
self.transport.write(input.encode(encoding))
self.state = next(self.states)
elif self.data == "\x1b[6n":
# this is a cursor position query
# respond that cursor is on row 2, column 1
self.transport.write("\x1b[2;1R".encode(encoding))
else:
self.transport.closeStdin()
if self.transport.pid is not None:
Expand All @@ -94,6 +98,7 @@ def processExited(self, reason):
f"bpython.{self.backend}",
"--config",
str(TEST_CONFIG),
"-q", # prevents version greeting
),
env={
"TERM": "vt100",
Expand Down Expand Up @@ -128,6 +133,11 @@ def check_no_traceback(self, data):
self.assertNotIn("Traceback", data)


@unittest.skipIf(reactor is None, "twisted is not available")
class CurtsiesCrashersTest(TrialTestCase, CrashersTest):
backend = "curtsies"


@unittest.skipIf(reactor is None, "twisted is not available")
class CursesCrashersTest(TrialTestCase, CrashersTest):
backend = "cli"
Expand Down