Open ivoflipse opened 11 years ago
Also check out Nosetest and the standard library unit testing and whatnot. Also the two Udacity courses on testing and debugging could be useful
http://about.travis-ci.org/docs/user/build-configuration/ https://nose.readthedocs.org/en/latest/ http://docs.python.org/2/library/unittest.html
I'm running into some problems with how I structured my module and importing everything. For example in configuration.py it couldn't find config.yaml, because it had a relative path and its having the same problems with the store_results_folder.
When trying nosetests, instead of IntelliJ's unittests, I get errors because it can't import other functions, since the folder structure doesn't cater to it.
Oh god, the problem was I was forgetting to name my methods test...blablabla.
So in an effort to get testing working, I've restructured my entire application and removed pubsub from functions and made it an external dependency.
On top of all that I found a bug where I was skipping the last frame
Adding PyTables broke quite a lot of testio test cases, so those need to get updated once I'm done with it
At least the tests are working and Travis CI is happy, but I've only added tests to io
and calculations
.
So I should get working on the other modules, especially utility, tracking and the models.
Here's a SO question about testing a PySide application: http://stackoverflow.com/questions/11145583/unit-and-functional-testing-a-pyside-based-application
PySide also has a QTest module: http://srinikom.github.io/pyside-docs/PySide/QtTest/QTest.html
To make sure I don't break things without noticing it, I should be adding tests (I know, I know). I've looked at TravisCI, which scikit-learn uses, which would be interesting.
It would be important to get the main components on which the entire application depends under test coverage. I'm looking at you tracking, calculations and contact model. It would also be a good approach to add assertions in some places where I expect certain behavior (like update not being called on empty contacts), so I can follow the paper trail that didn't catch such behavior.