Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

jjinux/sfpythontesting

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SF Python Testing

This is a lightning quick introduction to virtualenv, nose, mock, monkey patching, dependency injection, and doctest. See the blog post:

http://jjinux.blogspot.com/2014/01/python-lightning-quick-introduction-to.html

I first presented this material at SF Python Meetup, hence the name of the repository.

Setup

# Make sure you're using the version of Python you want to use.
which python

sudo easy_install -U setuptools
sudo easy_install pip
sudo pip install virtualenv
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

# Previously ran:
# pip install nose
# pip install mock
# pip freeze > requirements.txt
pip install -r requirements.txt

Running Tests

nosetests --with-doctest

About

This is some code I wrote for a talk I gave on testing at SF Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.