Skip to content

Commit 3d315dc

Browse files
Enable crashers tests for Curtsies (#881)
Enable crashers tests for Curtsies
1 parent 8d21739 commit 3d315dc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bpython/test/test_crashers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ def next(self):
7272
self.data = self.data[index + 4 :]
7373
self.transport.write(input.encode(encoding))
7474
self.state = next(self.states)
75+
elif self.data == "\x1b[6n":
76+
# this is a cursor position query
77+
# respond that cursor is on row 2, column 1
78+
self.transport.write("\x1b[2;1R".encode(encoding))
7579
else:
7680
self.transport.closeStdin()
7781
if self.transport.pid is not None:
@@ -94,6 +98,7 @@ def processExited(self, reason):
9498
f"bpython.{self.backend}",
9599
"--config",
96100
str(TEST_CONFIG),
101+
"-q", # prevents version greeting
97102
),
98103
env={
99104
"TERM": "vt100",
@@ -128,6 +133,11 @@ def check_no_traceback(self, data):
128133
self.assertNotIn("Traceback", data)
129134

130135

136+
@unittest.skipIf(reactor is None, "twisted is not available")
137+
class CurtsiesCrashersTest(TrialTestCase, CrashersTest):
138+
backend = "curtsies"
139+
140+
131141
@unittest.skipIf(reactor is None, "twisted is not available")
132142
class CursesCrashersTest(TrialTestCase, CrashersTest):
133143
backend = "cli"

0 commit comments

Comments
 (0)