eloraburns / ipython_nose Goto Github PK
View Code? Open in Web Editor NEWNose magic for IPython
Nose magic for IPython
e.g.
%nose -x
will only run tests until the first failure
This does what you'd expect:
import sys
import time
sys.stdout.write('a')
sys.stdout.flush()
time.sleep(5)
sys.stdout.write('b')
But when I do the equivalent within the extension/plugin, I get a separate line for each test's output. Not sure why.
TypeError Traceback (most recent call last)
in ()
----> 1 get_ipython().magic(u'nose')
/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2302 magic_name, _, magic_arg_s = arg_s.partition(' ')
2303 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2304 return self.run_line_magic(magic_name, magic_arg_s)
2305
2306 #-------------------------------------------------------------------------
/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2223 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2224 with self.builtin_trap:
-> 2225 result = fn(args,*kwargs)
2226 return result
2227
/resources/ipython_nose.pyc in nose(line, test_module)
402
403 nose_core.TestProgram(
--> 404 argv=argv, suite=tests, addplugins=[plug], exit=False, config=config)
405
406 return plug
/home/notebook/djvita/lib/python2.7/site-packages/nose/core.pyc in init(self, module, defaultTest, argv, testRunner, testLoader, env, config, suite, exit, plugins, addplugins)
119 self, module=module, defaultTest=defaultTest,
120 argv=argv, testRunner=testRunner, testLoader=testLoader,
--> 121 **extra_args)
122
123 def getAllConfigFiles(self, env=None):
/usr/lib/python2.7/unittest/main.pyc in init(self, module, defaultTest, argv, testRunner, testLoader, exit, verbosity, failfast, catchbreak, buffer)
92 self.testLoader = testLoader
93 self.progName = os.path.basename(argv[0])
---> 94 self.parseArgs(argv)
95 self.runTests()
96
/home/notebook/djvita/lib/python2.7/site-packages/nose/core.pyc in parseArgs(self, argv)
143 """Parse argv and env and configure running environment.
144 """
--> 145 self.config.configure(argv, doc=self.usage())
146 log.debug("configured %s", self.config)
147
/home/notebook/djvita/lib/python2.7/site-packages/nose/config.pyc in configure(self, argv, doc)
345 if not options.showPlugins:
346 self.plugins.configure(options, self)
--> 347 self.plugins.begin()
348
349 def configureLogging(self):
/home/notebook/djvita/lib/python2.7/site-packages/nose/plugins/manager.pyc in call(self, _arg, *_kw)
97
98 def call(self, _arg, *_kw):
---> 99 return self.call(_arg, *_kw)
100
101 def addPlugin(self, plugin, call):
/home/notebook/djvita/lib/python2.7/site-packages/nose/plugins/manager.pyc in simple(self, _arg, *_kw)
165 """
166 for p, meth in self.plugins:
--> 167 result = meth(_arg, *_kw)
168 if result is not None:
169 return result
/resources/ipython_nose.pyc in begin(self)
310 from IPython.zmq.displayhook import ZMQShellDisplayHook
311 if isinstance(sys.displayhook, ZMQShellDisplayHook):
--> 312 self.live_output = NotebookLiveOutput()
313 else:
314 self.live_output = ConsoleLiveOutput(self)
/resources/ipython_nose.pyc in init(self)
48 displaypub.publish_display_data(
49 u'IPython.core.displaypub.publish_html',
---> 50 {'text/html':'
/usr/local/lib/python2.7/dist-packages/IPython/core/display.pyc in publish_display_data(data, metadata, source)
114 InteractiveShell.instance().display_pub.publish(
115 data=data,
--> 116 metadata=metadata,
117 )
118
/usr/local/lib/python2.7/dist-packages/IPython/kernel/zmq/zmqshell.pyc in publish(self, data, metadata, source)
77 if metadata is None:
78 metadata = {}
---> 79 self._validate_data(data, metadata)
80 content = {}
81 content['data'] = encode_images(data)
/usr/local/lib/python2.7/dist-packages/IPython/core/displaypub.pyc in _validate_data(self, data, metadata)
48
49 if not isinstance(data, dict):
---> 50 raise TypeError('data must be a dict, got: %r' % data)
51 if metadata is not None:
52 if not isinstance(metadata, dict):
TypeError: data must be a dict, got: u'IPython.core.displaypub.publish_html'
IPython 2 worked fine. I'm on 3.0.0-f75fda4 and is running on: Python 2.7.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.