Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Python Testing
Python Testing
Credits
About the Author
About the Reviewers
Preface
What you need for this book
Who this book is for
Conventions
Time for action - heading
Reader feedback
Customer support
1. Testing for Fun and Profit
Types of testing
You've got Python, right?
Summary
2. Doctest: The Easiest Testing Tool
Time for action - creating and running your first doctest
Time for action - writing a more complex test
Time for action - expecting an exception
Time for action - using ellipsis in tests
Time for action - normalizing whitespace
Time for action skipping tests
Embedding doctests in Python docstrings
Time for action - embedding a doctest in a docstring
Putting it in practice: an AVL tree
Summary
3. Unit Testing with Doctest
Time for action - identifying units
Unit testing throughout the development process
Time for action - unit testing during design
Time for action - unit testing during development
Time for action - unit testing during feedback
Time for action - unit testing during development... again
Time for action - unit testing during maintenance
Time for action - unit testing during reuse
Summary
4. Breaking Tight Coupling by using Mock Objects
Time for action - installing Python Mocker
The idea of a mock object
Python Mocker
Time for action - exploring the basics of Mocker
Mocking self
Time for action - passing a mock object as self
Summary
5. When Doctest isn't Enough: Unittest to the Rescue
Time for action - testing PID with unittest
Test fixtures
Time for action - testing database-backed units
Integrating with Python Mocker
Summary
6. Running Your Tests: Follow Your Nose
Installing Nose
Organizing tests
Time for action - organizing tests from previous chapters
Nose and doctest
Time for action - creating a fixture for a doctest
Nose and unittest
Time for action - creating a module fixture
Time for action - creating a package fixture
Nose's own testing framework
Time for action - using Nose-specific tests
Summary
7. Developing a Test-Driven Project
Time for action - what are you going to do?
Writing initial unit tests
Time for action - nailing down the specification with unit tests
Coding planner.data
Using the tests to get the code right
Fixing the code
Time for action - writing and debugging code
Writing persistence tests
Writing persistence code
Finishing up
Summary
8. Testing Web Application Frontends using Twill
Exploring the Twill language
Time for action - browsing the web with Twill
Time for action - Twill scripting
Calling Twill scripts from tests
Time for action - running Twill script files
Time for action - running Twill script strings
Integrating Twill operations into unittest tests
Time for action - using Twill's browser object
Summary
9. Integration Testing and System Testing
Time for action - figuring out the order of integration
Automation with doctest, unittest, and Nose
Time for action - writing integration tests for the time planner
Summary
10. Other Testing Tools and Techniques
Time for action - using coverage.py
Version control hooks
Time for action - installing Nose as a Bazaar post-commit hook
Time for action - installing Nose as a Mercurial post-commit hook
Time for action - installing Nose as a Git post-commit hook
Time for action - installing Nose as a Darcs post-record hook
Time for action - installing Nose as a Subversion post-commit hook
Automated continuous integration
Time for action - using Buildbot with Bazaar
Summary
A. Answers to Pop Quizes
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
← Prev
Back
Next →
← Prev
Back
Next →