This cookbook is written as a collection of code recipes containing step-by-step directions on how to install or build different types of Python test tools to solve different problems. Each recipe contains explanations of how it works along with answers to common questions and cross references to ot
Python Testing Cookbook
β Scribed by Turnquist, Greg L
- Publisher
- Packt Publishing
- Year
- 2011
- Tongue
- English
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools.;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 ...
β¦ Table of Contents
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 ... 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. 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. 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 ... 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.
β¦ Subjects
Computer programming;Computer Science;Engineering & Applied Sciences;Object-oriented programming (Computer science);Python (Computer program language);Electronic book;Programming Languages;Electronic books
π SIMILAR VOLUMES
This cookbook is written as a collection of code recipes containing step-by-step directions on how to install or build different types of Python test tools to solve different problems. Each recipe contains explanations of how it works along with answers to common questions and cross references to ot
Making your life easier with automated testing of Python is the sole aim of this book. Because itβs a cookbook, you can take things at your own pace, in your own order, and learn practical application rather than nebulous theory. Learn to write tests at every level using a variety of Python testing
Over 50 hands-on recipes to help you pen test networks using Python, discover vulnerabilities, and find a recovery pathAbout This Book Learn to detect and avoid various types of attack that put system privacy at risk Enhance your knowledge of wireless application concepts and information gathering t
Buchanan C., Ip T., Mabbitt A., May B., Mound D.<div class="bb-sep"></div>Packt Publishing, 2015. β 228 p. β ISBN: 1784392936, 9781784392932<div class="bb-sep"></div>This book is for testers looking for quick access to powerful, modern tools and customizable scripts to kick-start the creation of the