One of the most tedious in tasks when building an application is writing unit tests. In fact, most programmers immediately frown when this word is even mentioned. However, when working on multiple projects that you may not get to finish, or someone else will pick it up on down the road, it’s always nice to include testing. How can you possibly expect any future developer to take over your code in a time efficient manner if they can’t test to make sure nothing is broken?
Now the tools I generally use for development is just Sublime Text 2, but any text editor is fine and if you want to go with a full IDE I highly recommend PyCharm from JetBrains. Now we’ll start with setting up a virtual environment for python and building our document structure. The reason for a virtual environment over using your systems, is well it’s just good practice! But seriously when working on anything outside of the general libraries for python it’s good to keep it contained within your own structure so you don’t have wind up with a ton of libraries hanging off your system. If you don’t have virtualenv already installed you’ll need it. Run the following in your terminal to get it:
Now we are ready. I do most of my setup within the terminal so I’m going to stay there for this blog post, and you should too unless you downloaded PyCharm in which case go ahead and setup a new project with a virtualenv of your own!