Skip to content

Instantly share code, notes, and snippets.

@jdmarch
Created April 23, 2012 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdmarch/2470181 to your computer and use it in GitHub Desktop.
Save jdmarch/2470181 to your computer and use it in GitHub Desktop.
IPython tracebacks from test_magic, for gh-1479
$ git log --oneline -4
55a60ff Merge branch 'i1479' of https://github.com/takluyver/ipython into takluyver-i1479
29e62c7 Merge pull request #1637 from dzderic/patch-1
3875904 Removed a ':' which shouldn't have been there
72d5107 Fix installing extension from local file on Windows.
$ iptest -v IPython.core.tests.test_magic
Test that references from %run are cleared by xdel. ... ok
IPython.core.tests.test_magic.test_rehashx(True,) ... ok
IPython.core.tests.test_magic.test_rehashx(True,) ... ok
Test that we don't mangle paths when parsing magic options. ... ok
IPython.core.tests.test_magic.test_macro ... ERROR
Test that we can run a multi-line macro successfully. ... ERROR
Test '%reset array' functionality ... ok
Test '%reset array' functionality ... ok
Test '%reset out' magic ... ok
Test '%reset in' magic ... ok
Test '%reset dhist' magic ... ok
Test that '%reset in' preserves In[] length ... ok
IPython.core.tests.test_magic.test_time ... ok
test %tb after a SyntaxError ... ok
Toggle doctest_mode twice, it should be a no-op and run without error ... ok
Tests for basic options parsing in magics. ... ok
Test various directory handling operations. ... ok
IPython.core.tests.test_magic.test_xmode ... ok
IPython.core.tests.test_magic.test_reset_hard ... ok
IPython.core.tests.test_magic.test_psearch ... ok
test shlex issues with timeit (#1109) ... ok
Test valid timeit arguments, should not cause SyntaxError (GH #1269) ... ok
Test that prun does not clobber string escapes (GH #1302) ... FAIL
IPython.core.tests.test_magic.test_extension ... ERROR
IPython.core.tests.test_magic.test_notebook_export_json ... ok
IPython.core.tests.test_magic.test_notebook_export_py ... ok
IPython.core.tests.test_magic.test_notebook_reformat_py ... ok
IPython.core.tests.test_magic.test_notebook_reformat_json ... ok
IPython.core.tests.test_magic.test_env ... ok
Doctest: IPython.core.tests.test_magic.doctest_precision ... ok
Doctest: IPython.core.tests.test_magic.doctest_time ... ok
Doctest: IPython.core.tests.test_magic.doctest_who ... ok
======================================================================
ERROR: IPython.core.tests.test_magic.test_macro
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "c:\documents and settings\jdm\ipython\IPython\testing\decorators.py", line 228, in skipper_func
return f(*args, **kwargs)
File "c:\Documents and Settings\JDM\ipython\IPython\core\tests\test_magic.py", line 171, in test_macro
ip.magic("macro test 1-3")
File "c:\documents and settings\jdm\ipython\IPython\core\interactiveshell.py", line 2036, in magic
result = fn(magic_args)
File "c:\documents and settings\jdm\ipython\IPython\core\magic.py", line 2189, in magic_macro
self.shell.define_macro(name, macro)
File "c:\documents and settings\jdm\ipython\IPython\core\interactiveshell.py", line 2075, in define_macro
from IPython.core import macro
ImportError: cannot import name macro
======================================================================
ERROR: Test that we can run a multi-line macro successfully.
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "c:\documents and settings\jdm\ipython\IPython\testing\decorators.py", line 228, in skipper_func
return f(*args, **kwargs)
File "c:\Documents and Settings\JDM\ipython\IPython\core\tests\test_magic.py", line 187, in test_macro_run
nt.assert_equal(ip.user_ns["test"].value,
KeyError: u'\'test\'\n-------------------- >> begin captured stdout << ---------------------\n11\n-------------------------------------
--------------------------------------\nImportError Traceback (most recent call last)\nc:\\Documents and
Settings\\JDM\\ipython\\<ipython-input-4-e34d24e22d79> in <module>()\n----> 1 get_ipython().magic(u\'macro test 2-3\')\n\nc:\\documents
and settings\\jdm\\ipython\\IPython\\core\\interactiveshell.pyc in magic(self, arg_s, next_input)\n 2034 self._magic
_locals = sys._getframe(1).f_locals\n 2035 with self.builtin_trap:\n-> 2036 result = fn(magic_args)\n 2
037 # Ensure we\'re not keeping object references around:\n 2038 self._magic_locals = {}\n\nc:\\documents and
settings\\jdm\\ipython\\IPython\\core\\magic.pyc in magic_macro(self, parameter_s)\n 2187 return\n 2188 macro
= Macro(lines)\n-> 2189 self.shell.define_macro(name, macro)\n 2190 print \'Macro `%s` created. To execute, type its
name (without quotes).\' % name\n 2191 print \'=== Macro contents: ===\'\n\nc:\\documents and settings\\jdm\\ipython\\IPython
\\core\\interactiveshell.pyc in define_macro(self, name, themacro)\n 2073 """\n 2074 \n-> 2075 from IPython.core im
port macro\n 2076 \n 2077 if isinstance(themacro, basestring):\n\nImportError: cannot import name macro\n\n----------------
----- >> end captured stdout << ----------------------'
======================================================================
ERROR: IPython.core.tests.test_magic.test_extension
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "c:\Documents and Settings\JDM\ipython\IPython\core\tests\test_magic.py", line 430, in test_extension
_ip.magic("install_ext %s" % url)
File "c:\documents and settings\jdm\ipython\IPython\core\interactiveshell.py", line 2036, in magic
result = fn(magic_args)
File "c:\documents and settings\jdm\ipython\IPython\core\magic.py", line 3459, in magic_install_ext
filename, headers = self.extension_manager.install_extension(args, opts.get('n'))
File "c:\documents and settings\jdm\ipython\IPython\core\extensions.py", line 154, in install_extension
return urlretrieve(url, filename)
File "c:\Python27\lib\urllib.py", line 91, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "c:\Python27\lib\urllib.py", line 237, in retrieve
fp = self.open(url, data)
File "c:\Python27\lib\urllib.py", line 202, in open
return self.open_unknown(fullurl, data)
File "c:\Python27\lib\urllib.py", line 214, in open_unknown
raise IOError, ('url error', 'unknown url type', type)
IOError: [Errno url error] unknown url type: 'c'
======================================================================
FAIL: Test that prun does not clobber string escapes (GH #1302)
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "c:\documents and settings\jdm\ipython\IPython\testing\decorators.py", line 228, in skipper_func
return f(*args, **kwargs)
File "c:\Documents and Settings\JDM\ipython\IPython\core\tests\test_magic.py", line 421, in test_prun_quotes
nt.assert_equal(_ip.user_ns['x'], '\t')
AssertionError: ' ' != '\t'
"' ' != '\\t'" = '%s != %s' % (safe_repr(' '), safe_repr('\t'))
"' ' != '\\t'" = self._formatMessage("' ' != '\\t'", "' ' != '\\t'")
>> raise self.failureException("' ' != '\\t'")
----------------------------------------------------------------------
Ran 32 tests in 25.438s
FAILED (errors=3, failures=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment