Small advice for Test-Driven Development (in Python)
Test-Driven Development, or the more undefined Test-Heavy Development works fine, but sometimes it can be annoying jumping between code and tests (even with a nice IDE like Pycharm and testing tools like py.test or nosetest).
Two ways to avoid this (small annoyance) are:
Use doctests - which are tests in the comment beneath the function declaration, i.e. keeps code and tests in the same file. This works nicely in the beginning of a project, but tends to get very messy to maintain and clutters the look of the source file.
Write the actual code within the unit test file, and when it works - "upgrade it" it to the source file (and keep the test), this way you can edit only in one file while making the function work. If you combine this with mockito you can also test integration of the function you're creating before it is "born" (or appears in the main source file).
Best regards,
Amund Tveit (twitter.com/atveit/)
http://atbrox.com/about/














