Skip to content

Commit

Permalink
Merge pull request #2864 from rlmv/issue2784
Browse files Browse the repository at this point in the history
Fix %run -t -N<N> TypeError
  • Loading branch information
takluyver committed Jan 29, 2013
2 parents df34852 + 95bde0f commit c7fc089
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion IPython/core/magics/execution.py
Expand Up @@ -627,7 +627,7 @@ def run(self, parameter_s='', runner=None,
t_sys = t1[1] - t0[1]
print "\nIPython CPU timings (estimated):"
print "Total runs performed:", nruns
print " Times : %10.2f %10.2f" % ('Total', 'Per run')
print " Times : %10s %10s" % ('Total', 'Per run')
print " User : %10.2f s, %10.2f s." % (t_usr, t_usr / nruns)
print " System : %10.2f s, %10.2f s." % (t_sys, t_sys / nruns)
twall1 = time.time()
Expand Down
7 changes: 7 additions & 0 deletions IPython/core/tests/test_run.py
Expand Up @@ -330,3 +330,10 @@ def test_run_ipy_file_attribute(self):

# Check that __file__ was not leaked back into user_ns.
nt.assert_equal(file1, file2)

def test_run_formatting(self):
""" Test that %run -t -N<N> does not raise a TypeError for N > 1."""
src = "pass"
self.mktmp(src)
_ip.magic('run -t -N 1 %s' % self.fname)
_ip.magic('run -t -N 10 %s' % self.fname)

0 comments on commit c7fc089

Please sign in to comment.