You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import unittest
from src import add
class AddTestCase(unittest.TestCase):
def test_add(self):
"""Is five successfully determined to be prime?"""
addition = add.add(2,3)
self.assertEquals(5, addition)
if __name__ == '__main__':
unittest.main()
Tested function:
def add(x, y):
return x+y
Traceback
File "C:\Users\acorbi\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_unittest\widgets\unittestgui.py", line 342, in tests_startedself.testdatamodel.update_testresults(testresults)
File "C:\Users\acorbi\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_unittest\widgets\datatree.py", line 265, in update_testresultsraiseKeyError('test not found')
KeyError: 'test not found'
Traceback (most recent call last):
File "C:\Users\acorbi\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_unittest\widgets\unittestgui.py", line 354, in tests_yield_resultself.testdatamodel.update_testresults(testresults)
File "C:\Users\acorbi\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_unittest\widgets\datatree.py", line 265, in update_testresultsraiseKeyError('test not found')
KeyError: 'test not found'
@Korbz What version of the spyder-unittest plugin are you using? A very similar issue was fixed in version 0.3.0, so maybe uprading the plugin will fix this for you.
@Korbz What version of the spyder-unittest plugin are you using? A very similar issue was fixed in version 0.3.0, so maybe uprading the plugin will fix this for you.
I'm using version 0.3.1.
Switching the test framework to nose solved this issue.
I can reproduce this, except that Spyder hangs on my computer. I think it has to do with the docstring in the test function. Unittest prints out this docstring and that confuses the parser. I will try to fix this.
Description
What steps will reproduce the problem?
Started a unit test case with unittest
Unit Test class:
Tested function:
Traceback
Versions
Dependencies
The text was updated successfully, but these errors were encountered: