##// END OF EJS Templates
Remove unused imports from IPython.core
Thomas Kluyver -
Show More
@@ -21,7 +21,6 b' import os'
21 21 from shutil import copyfile
22 22 import sys
23 23
24 from IPython.core.error import UsageError
25 24 from IPython.config.configurable import Configurable
26 25 from IPython.utils.traitlets import Instance
27 26 from IPython.utils.py3compat import PY3
@@ -10,12 +10,6 b''
10 10 #-----------------------------------------------------------------------------
11 11
12 12 #-----------------------------------------------------------------------------
13 # Imports
14 #-----------------------------------------------------------------------------
15
16 import warnings
17
18 #-----------------------------------------------------------------------------
19 13 # Classes and functions
20 14 #-----------------------------------------------------------------------------
21 15
@@ -71,7 +71,6 b' import re'
71 71 import sys
72 72
73 73 # IPython modules
74 from IPython.core.splitinput import split_user_input, LineInfo
75 74 from IPython.utils.py3compat import cast_unicode
76 75 from IPython.core.inputtransformer import (leading_indent,
77 76 classic_prompt,
@@ -85,7 +84,7 b' from IPython.core.inputtransformer import (leading_indent,'
85 84 assemble_python_lines,
86 85 )
87 86
88 # Temporary!
87 # These are available in this module for backwards compatibility.
89 88 from IPython.core.inputtransformer import (ESC_SHELL, ESC_SH_CAP, ESC_HELP,
90 89 ESC_HELP2, ESC_MAGIC, ESC_MAGIC2,
91 90 ESC_QUOTE, ESC_QUOTE2, ESC_PAREN, ESC_SEQUENCES)
@@ -3,7 +3,7 b' import functools'
3 3 import re
4 4 from StringIO import StringIO
5 5
6 from IPython.core.splitinput import split_user_input, LineInfo
6 from IPython.core.splitinput import LineInfo
7 7 from IPython.utils import tokenize2
8 8 from IPython.utils.tokenize2 import generate_tokens, untokenize, TokenError
9 9
@@ -15,7 +15,6 b''
15 15 # Imports
16 16 #-----------------------------------------------------------------------------
17 17 # Stdlib
18 import json
19 18 import os
20 19 import re
21 20 import sys
@@ -20,11 +20,10 b' import sys'
20 20 from pprint import pformat
21 21
22 22 # Our own packages
23 from IPython.core import magic_arguments
23 from IPython.core import magic_arguments, page
24 24 from IPython.core.error import UsageError
25 25 from IPython.core.magic import Magics, magics_class, line_magic, magic_escapes
26 26 from IPython.utils.text import format_screen, dedent, indent
27 from IPython.core import magic_arguments, page
28 27 from IPython.testing.skipdoctest import skip_doctest
29 28 from IPython.utils.ipstruct import Struct
30 29 from IPython.utils.path import unquote_filename
@@ -18,15 +18,12 b' from __future__ import print_function'
18 18 __all__ = ['Inspector','InspectColors']
19 19
20 20 # stdlib modules
21 import __builtin__
22 21 import inspect
23 22 import linecache
24 23 import os
25 import sys
26 24 import types
27 25 import io as stdlib_io
28 26
29 from collections import namedtuple
30 27 try:
31 28 from itertools import izip_longest
32 29 except ImportError:
@@ -29,11 +29,7 b' import re'
29 29 from IPython.core.autocall import IPyAutocall
30 30 from IPython.config.configurable import Configurable
31 31 from IPython.core.inputsplitter import (
32 ESC_SHELL,
33 ESC_SH_CAP,
34 ESC_HELP,
35 32 ESC_MAGIC,
36 ESC_MAGIC2,
37 33 ESC_QUOTE,
38 34 ESC_QUOTE2,
39 35 ESC_PAREN,
@@ -15,11 +15,7 b' import tempfile'
15 15 import unittest
16 16 from os.path import join
17 17
18 import nose.tools as nt
19 from nose import SkipTest
20
21 18 from IPython.core.completerlib import magic_run_completer, module_completion
22 from IPython.utils import py3compat
23 19 from IPython.utils.tempdir import TemporaryDirectory
24 20
25 21
@@ -122,7 +122,7 b' def test_ipdb_magics():'
122 122 ipdb> continue
123 123 '''
124 124
125 def test_ipdb_magics():
125 def test_ipdb_magics2():
126 126 '''Test ipdb with a very short function.
127 127
128 128 >>> def bar():
@@ -3,7 +3,7 b''
3 3
4 4 import nose.tools as nt
5 5
6 from IPython.core.fakemodule import FakeModule, init_fakemod_dict
6 from IPython.core.fakemodule import FakeModule
7 7
8 8 # Make a fakemod and check a few properties
9 9 def test_mk_fakemod():
@@ -9,8 +9,7 b' except:'
9 9 numpy = None
10 10 import nose.tools as nt
11 11
12 from IPython.core.formatters import FormatterABC, PlainTextFormatter
13 from IPython.lib import pretty
12 from IPython.core.formatters import PlainTextFormatter
14 13
15 14 class A(object):
16 15 def __repr__(self):
@@ -7,10 +7,8 b''
7 7
8 8 # stdlib
9 9 import os
10 import shutil
11 10 import sys
12 11 import tempfile
13 import unittest
14 12 from datetime import datetime
15 13
16 14 # third party
@@ -388,14 +388,6 b' class InteractiveLoopTestCase(unittest.TestCase):'
388 388 self.check_ns(['x =(1+','1+','2)'], dict(x=4))
389 389
390 390
391 def test_LineInfo():
392 """Simple test for LineInfo construction and str()"""
393 linfo = isp.LineInfo(' %cd /home')
394 nt.assert_equal(str(linfo), 'LineInfo [ |%|cd|/home]')
395
396
397
398
399 391 class IPythonInputTestCase(InputSplitterTestCase):
400 392 """By just creating a new class whose .isp is a different instance, we
401 393 re-run the same test battery on the new input splitter.
@@ -1,5 +1,4 b''
1 1 import tokenize
2 import unittest
3 2 import nose.tools as nt
4 3
5 4 from IPython.testing import tools as tt
@@ -4,17 +4,11 b''
4 4 # Module imports
5 5 #-----------------------------------------------------------------------------
6 6
7 # stdlib
8 import os
9 import shutil
10 import tempfile
11
12 7 # third party
13 8 import nose.tools as nt
14 9
15 10 # our own packages
16 11 from IPython.testing.globalipapp import get_ipython
17 from IPython.utils import py3compat
18 12
19 13 #-----------------------------------------------------------------------------
20 14 # Globals
@@ -476,8 +476,6 b' def test_timeit_arguments():'
476 476
477 477 def test_timeit_special_syntax():
478 478 "Test %%timeit with IPython special syntax"
479 from IPython.core.magic import register_line_magic
480
481 479 @register_line_magic
482 480 def lmagic(line):
483 481 ip = get_ipython()
@@ -208,7 +208,7 b' def test_calltip_cell_magic():'
208 208 check_calltip(cmagic, 'cmagic', 'cmagic(line, cell)', "A cell magic")
209 209
210 210
211 def test_calltip_line_magic():
211 def test_calltip_line_cell_magic():
212 212 check_calltip(lcmagic, 'lcmagic', 'lcmagic(line, cell=None)',
213 213 "A line/cell magic")
214 214
@@ -6,7 +6,7 b''
6 6 import nose.tools as nt
7 7
8 8 from IPython.core.prefilter import AutocallChecker
9 from IPython.testing import tools as tt, decorators as dec
9 from IPython.testing import decorators as dec
10 10 from IPython.testing.globalipapp import get_ipython
11 11
12 12 #-----------------------------------------------------------------------------
@@ -29,7 +29,6 b' import tempfile'
29 29 from unittest import TestCase
30 30
31 31 import nose.tools as nt
32 from nose import SkipTest
33 32
34 33 from IPython.core.profileapp import list_profiles_in, list_bundled_profiles
35 34 from IPython.core.profiledir import ProfileDir
@@ -4,12 +4,10 b''
4 4 import unittest
5 5
6 6 import os
7 import nose.tools as nt
8 7
9 8 from IPython.testing import tools as tt, decorators as dec
10 9 from IPython.core.prompts import PromptManager, LazyEvaluate
11 10 from IPython.testing.globalipapp import get_ipython
12 from IPython.utils import py3compat
13 11 from IPython.utils.tempdir import TemporaryDirectory
14 12
15 13 ip = get_ipython()
@@ -17,8 +17,6 b' Authors'
17 17 #-----------------------------------------------------------------------------
18 18 import unittest
19 19
20 import nose.tools as nt
21
22 20 from IPython.testing import decorators as dec
23 21 from IPython.testing import tools as tt
24 22
@@ -1,5 +1,7 b''
1 1 # coding: utf-8
2 from IPython.core.splitinput import split_user_input
2 import nose.tools as nt
3
4 from IPython.core.splitinput import split_user_input, LineInfo
3 5 from IPython.testing import tools as tt
4 6 from IPython.utils import py3compat
5 7
@@ -33,3 +35,8 b' else:'
33 35
34 36 def test_split_user_input():
35 37 return tt.check_pairs(split_user_input, tests)
38
39 def test_LineInfo():
40 """Simple test for LineInfo construction and str()"""
41 linfo = LineInfo(' %cd /home')
42 nt.assert_equal(str(linfo), 'LineInfo [ |%|cd|/home]')
General Comments 0
You need to be logged in to leave comments. Login now