~dinko-metalac/calculus-app2/trunk

« back to all changes in this revision

Viewing changes to lib/py/sympy/interactive/tests/test_ipython.py

  • Committer: dinko.metalac at gmail
  • Date: 2015-04-14 13:28:14 UTC
  • Revision ID: dinko.metalac@gmail.com-20150414132814-j25k3qd7sq3warup
new sympy

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
# run_cell was added in IPython 0.11
16
16
ipython = import_module("IPython", min_module_version="0.11")
 
17
readline = import_module("readline")
17
18
 
18
19
if not ipython:
19
20
    #bin/test will not execute any tests now
21
22
 
22
23
 
23
24
def test_automatic_symbols():
 
25
    # this implicitly requires readline
 
26
    if not readline:
 
27
        return None
24
28
    # NOTE: Because of the way the hook works, you have to use run_cell(code,
25
29
    # True).  This means that the code must have no Out, or it will be printed
26
30
    # during the tests.
52
56
def test_int_to_Integer():
53
57
    # XXX: Warning, don't test with == here.  0.5 == Rational(1, 2) is True!
54
58
    app = init_ipython_session()
 
59
    app.run_cell("from sympy import Integer")
55
60
    app.run_cell("a = 1")
56
61
    assert isinstance(app.user_ns['a'], int)
57
62