Python: A lightning quick introduction to virtualenv, nose, mock, monkey patching, dependency injection, and doctest
pip pip is a tool for installing Python packages. Python 2.7.9 and later include pip by default. If you don't have pip, you'll need to install it . virtualenv virtualenv is a tool for installing Python packages locally (i.e. local to a particular project) instead of globally. Here's how to get everything setup: # Make sure you're using the version of Python and pip that you want to use. sudo which python sudo which pip sudo pip install virtualenv Now, let's setup a new project: mkdir ~/Desktop/sfpythontesting cd ~/Desktop/sfpythontesting virtualenv env # Do this anytime you want to work on the application. . env/bin/activate # Make sure that pip is running from within the env. which pip pip install nose pip install mock pip freeze > requirements.txt # Now that you've created a requirements.txt, other people can just run: # pip install -r requirements.txt nose Nose is a popular Python testing library. It simple and powerful. Setup t