The test module in the 3rd project in Scientific Computing with Python, called Budget App, doesn’t take into account that there are already objects instantiated in the main.py script, thus the ledger for each category object is already populated with data. As a result, any test case will result in an assertion error given that each method of UnitTests performs the assertion on its own data.
The test suite instantiates new objects with their own data. You shouldn’t see any effect of the objects instantiated in main.py in the test suite. I suspect you may be incorrectly using global variables in some fashion. It would be helpful to see your code for this project.
Thanks in advance
Ah ha, you have hit the classic problem:
Oops I discovered now that I defined a class variable in wrong way, you’re right.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.