mahmoudimus / nose-timer

A timer plugin for nosetests (how much time does every test take?)
MIT License
126 stars 33 forks source link

Fails on when tests are skipped #20

Closed jsalvatier closed 10 years ago

jsalvatier commented 10 years ago

Skipping a test leads to an error:

import unittest
from nose import SkipTest

class TestGLM(unittest.TestCase):

    @unittest.skip("skippit!")
    def test_one(self):
        assert True

nosetests -vv --with-timer --timer-verbose nose.config: INFO: Ignoring files matching ['^.', '^_', '^setup.py$'] test_one (test_stuff.TestGLM) ... SKIP: skippit! Traceback (most recent call last): File "/usr/local/bin/nosetests", line 9, in load_entry_point('nose==1.2.1', 'console_scripts', 'nosetests')() File "/usr/local/lib/python2.7/dist-packages/nose/core.py", line 118, in init _extra_args) File "/usr/lib/python2.7/unittest/main.py", line 95, in init self.runTests() File "/usr/local/lib/python2.7/dist-packages/nose/core.py", line 197, in runTests result = self.testRunner.run(self.test) File "/usr/local/lib/python2.7/dist-packages/nose/core.py", line 61, in run test(result) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 176, in call return self.run(_arg, _kw) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 223, in run test(orig) File "/usr/lib/python2.7/unittest/suite.py", line 70, in call return self.run(_args, _kwds) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 74, in run test(result) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 176, in call return self.run(_arg, _kw) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 223, in run test(orig) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 176, in call return self.run(_arg, _kw) File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 223, in run test(orig) File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 45, in call return self.run(_arg, _kwarg) File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 140, in run self.afterTest(result) File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 64, in afterTest afterTest(self.test) File "/usr/local/lib/python2.7/dist-packages/nose/proxy.py", line 114, in afterTest self.plugins.afterTest(self.test) File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 99, in call return self.call(_arg, *_kw) File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 167, in simple result = meth(_arg, **kw) File "/usr/local/lib/python2.7/dist-packages/nosetimer/plugin.py", line 52, in afterTest log.info(self._timed_tests[test.id()]) KeyError: 'test_stuff.TestGLM.test_one'

skudriashev commented 10 years ago

This one is fixed, can some one take a look, please?

mahmoudimus commented 10 years ago

yep I'll take a look this weekend

On Saturday, February 15, 2014, Stanislav notifications@github.com wrote:

This one is fixed, can some one take a look, please?

Reply to this email directly or view it on GitHubhttps://github.com/mahmoudimus/nose-timer/issues/20#issuecomment-35165776 .

Mahmoud Abdelkader http://mahmoudimus.com/blog

skudriashev commented 10 years ago

Awesome, thanks!)

skudriashev commented 10 years ago

Fix committed. So this one can be closed.

mahmoudimus commented 10 years ago

Fixed by #29