Python Testing Cookbook


Greg L. Turnquist
Bok Engelsk 2011 · Electronic books.
Annen tittel
Utgitt
Birmingham : : Packt Publishing, , 2011.
Omfang
1 online resource (602 p.)
Opplysninger
Description based upon print version of record.. - Python Testing Cookbook; Python Testing Cookbook; Credits; About the Author; About the Reviewers; www.PacktPub.com; Support files, eBooks, discount offers and more; Why Subscribe?; Free Access for Packt account holders; Preface; What this book covers; What you need for this book; Who this book is for; Conventions; Reader feedback; Customer support; Downloading the example code; Errata; Piracy; Questions; 1. Using Unittest To Develop Basic Tests; Introduction; Asserting the basics; Getting ready; How to do it...; How it works...; There's more.... - Defining test suites inside the test moduleHow to do it...; How it works...; There's more...; Test suite methods must be outside of the test class; Why have different suites?; optparse is being phased out and replaced by argparse; Retooling old test code to run inside unittest; How to do it...; How it works...; There's more...; Where are the bugs?; FunctionTestCase is a temporary measure; Breaking down obscure tests into simple ones; How to do it...; How it works...; There's more...; Where is the bug?; What is the right size for a test method?; Unittests versus integration tests. - How it works...There's more; Writing a nose extension to pick tests based on regular expressions; Getting ready; How to do it...; How it works...; There's more...; Writing a nose extension to generate a CSV report; Getting ready; How to do it...; How it works...; There's more...; Writing a project-level script that lets you run different test suites; How to do it...; How it works...; There's more; Why use getopt instead of optparse?; 3. Creating Testable Documentation with doctest; Introduction; Documenting the basics; How to do it...; How it works...; There's more...; Catching stack traces. - How to do it.... - Testing the edgesHow to do it...; How it works...; There's more...; Identifying the edges is important; Testing for unexpected conditions; Testing corner cases by iteration; How to do it...; How it works...; There's more...; Does this defy the recipe-Breaking down obscure tests into simple ones?; How does this compare with the recipe-Testing the edges?; See also; 2. Running Automated Test Suites with Nose; Introduction; Getting nosy with testing; How to do it...; How it works...; There's more...; Nose is extensible; Nose is embeddable; See also; Embedding nose inside Python; How to do it.... - assertEquals is preferred over assertTrue and assertFalseself.fail([msg]) can usually be rewritten with assertions; Our version of Python can impact our options; Setting up and tearing down a test harness; How to do it...; How it works...; Running test cases from the command line with increased verbosity; How to do it...; How it works...; There's more...; Running a subset of test case methods; How to do it...; How it works...; Chaining together a suite of tests; How to do it...; How it works...; There's more...; Name of the test case should be significant. - Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools
Emner
Sjanger
Dewey
ISBN
9781849514668

Bibliotek som har denne