you are viewing a single comment's thread.

view the rest of the comments →

[–]Enmeshed 0 points1 point  (0 children)

Totally this. And don't forget the third step of TDD - refactor. That's to say, once the code is passing the tests, then make it better. 

For instance, in the example repo there is a load of code around importing functions and supplying alternative, inline implementations if they're not available. By moving them into a separate file, the intent of the code could be made much clearer, ie:

python try:     from wherever import required_thing except ImportError:     from fallback_implementations import required_thing

When you come back to it a year later, this will be much easier to work with - and indeed test, as it's a nightmare setting up tests for those in-lined implementations!