Skip to content

Commit 20241ea

Browse files
committed
Remove workaround for < Python 3.11
1 parent d5a8af4 commit 20241ea

File tree

1 file changed

+12
-75
lines changed

1 file changed

+12
-75
lines changed

bpython/test/test_interpreter.py

Lines changed: 12 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -21,66 +21,17 @@ def test_syntaxerror(self):
2121

2222
i.runsource("1.1.1.1")
2323

24-
if (3, 10, 1) <= sys.version_info[:3]:
25-
expected = (
26-
" File "
27-
+ green('"<input>"')
28-
+ ", line "
29-
+ bold(magenta("1"))
30-
+ "\n 1.1.1.1\n ^^\n"
31-
+ bold(red("SyntaxError"))
32-
+ ": "
33-
+ cyan("invalid syntax")
34-
+ "\n"
35-
)
36-
elif (3, 10) <= sys.version_info[:2]:
37-
expected = (
38-
" File "
39-
+ green('"<input>"')
40-
+ ", line "
41-
+ bold(magenta("1"))
42-
+ "\n 1.1.1.1\n ^^^^^\n"
43-
+ bold(red("SyntaxError"))
44-
+ ": "
45-
+ cyan("invalid syntax. Perhaps you forgot a comma?")
46-
+ "\n"
47-
)
48-
elif (3, 8) <= sys.version_info[:2]:
49-
expected = (
50-
" File "
51-
+ green('"<input>"')
52-
+ ", line "
53-
+ bold(magenta("1"))
54-
+ "\n 1.1.1.1\n ^\n"
55-
+ bold(red("SyntaxError"))
56-
+ ": "
57-
+ cyan("invalid syntax")
58-
+ "\n"
59-
)
60-
elif pypy:
61-
expected = (
62-
" File "
63-
+ green('"<input>"')
64-
+ ", line "
65-
+ bold(magenta("1"))
66-
+ "\n 1.1.1.1\n ^\n"
67-
+ bold(red("SyntaxError"))
68-
+ ": "
69-
+ cyan("invalid syntax")
70-
+ "\n"
71-
)
72-
else:
73-
expected = (
74-
" File "
75-
+ green('"<input>"')
76-
+ ", line "
77-
+ bold(magenta("1"))
78-
+ "\n 1.1.1.1\n ^\n"
79-
+ bold(red("SyntaxError"))
80-
+ ": "
81-
+ cyan("invalid syntax")
82-
+ "\n"
83-
)
24+
expected = (
25+
" File "
26+
+ green('"<input>"')
27+
+ ", line "
28+
+ bold(magenta("1"))
29+
+ "\n 1.1.1.1\n ^^\n"
30+
+ bold(red("SyntaxError"))
31+
+ ": "
32+
+ cyan("invalid syntax")
33+
+ "\n"
34+
)
8435

8536
a = i.a
8637
self.assertMultiLineEqual(str(plain("").join(a)), str(expected))
@@ -114,7 +65,7 @@ def gfunc():
11465
+ cyan(global_not_found)
11566
+ "\n"
11667
)
117-
elif (3, 11) <= sys.version_info[:2]:
68+
else:
11869
expected = (
11970
"Traceback (most recent call last):\n File "
12071
+ green('"<input>"')
@@ -129,20 +80,6 @@ def gfunc():
12980
+ cyan(global_not_found)
13081
+ "\n"
13182
)
132-
else:
133-
expected = (
134-
"Traceback (most recent call last):\n File "
135-
+ green('"<input>"')
136-
+ ", line "
137-
+ bold(magenta("1"))
138-
+ ", in "
139-
+ cyan("<module>")
140-
+ "\n gfunc()\n"
141-
+ bold(red("NameError"))
142-
+ ": "
143-
+ cyan(global_not_found)
144-
+ "\n"
145-
)
14683

14784
a = i.a
14885
self.assertMultiLineEqual(str(expected), str(plain("").join(a)))

0 commit comments

Comments
 (0)