Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix Integer() wrapper transformer, thanks to @asmeurer

  • Loading branch information...
commit 0a4b2c7c63c2dc1fd2ec86df9f6c3e2f4ac11443 1 parent 9454c26
Thomas Kluyver authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 IPython/core/tests/test_interactiveshell.py
5 IPython/core/tests/test_interactiveshell.py
View
@@ -486,6 +486,7 @@ def visit_Num(self, node):
if isinstance(node.n, int):
return ast.Call(func=ast.Name(id='Integer', ctx=ast.Load()),
args=[node], keywords=[])
+ return node
class TestAstTransform2(unittest.TestCase):
def setUp(self):
@@ -505,6 +506,10 @@ def tearDown(self):
def test_run_cell(self):
ip.run_cell("n = 2")
self.assertEqual(self.calls, [(2,)])
+
+ # This shouldn't throw an error
+ ip.run_cell("o = 2.0")
+ self.assertEqual(ip.user_ns['o'], 2.0)
def test_timeit(self):
called = set()
Please sign in to comment.
Something went wrong with that request. Please try again.