##// END OF EJS Templates
Remove 5s wait on inactivity on GUI inputhook loops...
Remove 5s wait on inactivity on GUI inputhook loops The 5s (and 1s) waits were originally added in commit 5074878, but the 5 second wait meant if you left the console for 5+ minutes idle, it would take up to 5 seconds for a response to a keypress. This tradeoff of CPU cycles for battery life seems too far. Note that commit 5074878 was originally for wx, glut and pyglet are based on the wx version and came into existence after commit 5074878.

File last commit:

r12400:695d4711
r13125:f9e20986
Show More
test_launcher.py
58 lines | 2.0 KiB | text/x-python | PythonLexer
MinRK
Split swallow_argv into standalone function in lib.kernel...
r5620 """Tests for kernel utility functions
Authors
-------
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2011, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Third-party imports
import nose.tools as nt
# Our own imports
MinRK
test IPython.kernel
r9356 from IPython.kernel.launcher import swallow_argv
MinRK
Split swallow_argv into standalone function in lib.kernel...
r5620
#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
def test_swallow_argv():
tests = [
# expected , argv , aliases, flags
(['-a', '5'], ['-a', '5'], None, None),
(['5'], ['-a', '5'], None, ['a']),
([], ['-a', '5'], ['a'], None),
([], ['-a', '5'], ['a'], ['a']),
([], ['--foo'], None, ['foo']),
MinRK
update swallow_argv test with prefix-matching
r10427 ([], ['--foo'], ['foobar'], []),
MinRK
Split swallow_argv into standalone function in lib.kernel...
r5620 ([], ['--foo', '5'], ['foo'], []),
([], ['--foo=5'], ['foo'], []),
(['--foo=5'], ['--foo=5'], [], ['foo']),
(['5'], ['--foo', '5'], [], ['foo']),
(['bar'], ['--foo', '5', 'bar'], ['foo'], ['foo']),
(['bar'], ['--foo=5', 'bar'], ['foo'], ['foo']),
(['5','bar'], ['--foo', '5', 'bar'], None, ['foo']),
(['bar'], ['--foo', '5', 'bar'], ['foo'], None),
(['bar'], ['--foo=5', 'bar'], ['foo'], None),
]
for expected, argv, aliases, flags in tests:
MinRK
test IPython.kernel
r9356 stripped = swallow_argv(argv, aliases=aliases, flags=flags)
MinRK
Split swallow_argv into standalone function in lib.kernel...
r5620 message = '\n'.join(['',
"argv: %r" % argv,
"aliases: %r" % aliases,
"flags : %r" % flags,
"expected : %r" % expected,
"returned : %r" % stripped,
])
Thomas Kluyver
Remove uses of @parametric decorator
r12374 nt.assert_equal(expected, stripped, message)
MinRK
Split swallow_argv into standalone function in lib.kernel...
r5620