Skip to content

Commit 018be6d

Browse files
Update tests for Python 3.10
1 parent 74d919d commit 018be6d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

bpython/test/test_curtsies_painting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ def test_completion(self):
138138
"│ and any( │",
139139
"└──────────────────────────────┘",
140140
"Welcome to bpython! Press <F1> f",
141+
] if sys.version_info[:2] < (3, 10) else [
142+
">>> an",
143+
"┌──────────────────────────────┐",
144+
"│ and anext( any( │",
145+
"└──────────────────────────────┘",
146+
"Welcome to bpython! Press <F1> f",
141147
]
142148
)
143149
self.assert_paint_ignoring_formatting(screen, (0, 4))

bpython/test/test_interpreter.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,19 @@ def test_syntaxerror(self):
3535

3636
i.runsource("1.1.1.1")
3737

38-
if sys.version_info[:2] >= (3, 8):
38+
if sys.version_info[:2] >= (3, 10):
39+
expected = (
40+
" File "
41+
+ green('"<bpython-input-148>"')
42+
+ ", line "
43+
+ bold(magenta("1"))
44+
+ "\n 1.1.1.1\n ^^^^^\n"
45+
+ bold(red("SyntaxError"))
46+
+ ": "
47+
+ cyan("invalid syntax. Perhaps you forgot a comma?")
48+
+ "\n"
49+
)
50+
elif (3, 8) <= sys.version_info[:2] <= (3, 9):
3951
expected = (
4052
" File "
4153
+ green('"<input>"')

0 commit comments

Comments
 (0)