JetBrains / teamcity-messages

Python Unit Test Reporting to TeamCity
https://pypi.python.org/pypi/teamcity-messages
Apache License 2.0
137 stars 81 forks source link

Keyerror in unittestpy.py #196

Closed throwable-one closed 5 years ago

throwable-one commented 5 years ago

https://youtrack.jetbrains.com/issue/PY-31827

https://github.com/saltstack/salt/blob/develop/tests/unit/states/test_jboss7.py

    time_diff = datetime.datetime.now() - self.test_started_datetime_map[test_id]
KeyError: u'test_jboss7.JBoss7StateTestCase.test_should_create_binding_if_not_exists ([CPU:0_0%|MEM:42_5%] )'
throwable-one commented 5 years ago

To reproduce just change shortDescription in the middle of the test

from unittest import TestCase

class Foo(TestCase):
    a = 1

    def test_aa(self):
        pass

    def shortDescription(self):
        s = str(self.a)
        self.a += 10
        return s