GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix tests · MarkTseng/bpython@4cb4e77

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bpython/test
    • test_interpreter.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/test/test_interpreter.py‎

Copy file name to clipboardExpand all lines: bpython/test/test_interpreter.py
+4-11Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import unicode_literals
44

5-
import linecache
65
import sys
76

87
from curtsies.fmtfuncs import bold, green, magenta, cyan, red, plain
@@ -14,12 +13,6 @@
1413
pypy = 'PyPy' in sys.version
1514

1615

17-
def _last_console_filename():
18-
"""Returns the last 'filename' used for console input
19-
(as will be displayed in a traceback)."""
20-
return '<bpython-input-%s>' % (len(linecache.cache.bpython_history) - 1)
21-
22-
2316
class TestInterpreter(unittest.TestCase):
2417
def test_syntaxerror(self):
2518
i = interpreter.Interp()
@@ -33,13 +26,13 @@ def append_to_a(message):
3326

3427
if pypy:
3528
expected = (
36-
' File ' + green('"%s"' % _last_console_filename()) +
29+
' File ' + green('"<input>"') +
3730
', line ' + bold(magenta('1')) + '\n 1.1.1.1\n ^\n' +
3831
bold(red('SyntaxError')) + ': ' + cyan('invalid syntax') +
3932
'\n')
4033
else:
4134
expected = (
42-
' File ' + green('"%s"' % _last_console_filename()) +
35+
' File ' + green('"<input>"') +
4336
', line ' + bold(magenta('1')) + '\n 1.1.1.1\n ^\n' +
4437
bold(red('SyntaxError')) + ': ' + cyan('invalid syntax') +
4538
'\n')
@@ -62,7 +55,7 @@ def f():
6255
def g():
6356
return f()
6457

65-
i.runsource('g()', encode=False)
58+
i.runsource('g()')
6659

6760
if pypy:
6861
global_not_found = "global name 'g' is not defined"
@@ -71,7 +64,7 @@ def g():
7164

7265
expected = (
7366
'Traceback (most recent call last):\n File ' +
74-
green('"%s"' % _last_console_filename()) + ', line ' +
67+
green('"<input>"') + ', line ' +
7568
bold(magenta('1')) + ', in ' + cyan('<module>') + '\n g()\n' +
7669
bold(red('NameError')) + ': ' + cyan(global_not_found) + '\n')
7770

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.