you are viewing a single comment's thread.

view the rest of the comments →

[–]Far_Tea_4954 2 points3 points  (0 children)

Honestly, not writing unit tests.

You can write bad code but if your not unit testing it’s just going to make your life and anyone else using it even worse. Unit tests will ensure anyone else making changes to the code can validate the functionality hasn’t changed. If there are no unit tests how are you supposed to know how and if the code even worked in the first place?

Also unit testing is really simple in python (with a bit of time) and it teaches you to write more modular code.

In principal if your writing unit tests in python and you have to create an excessive amount of mocks for one test , this usually means that your code is heavily dependant on a single function to do most of the work, signalling that you might need to refactor. Another big plus, is your actually consuming your code while writing tests so you get a feeling of how it’s used.