Record:   Prev Next
作者 Turnquist, Greg L
書名 Python Testing Cookbook
出版項 Olton : Packt Publishing, Limited, 2011
©2011
國際標準書號 9781849514675 (electronic bk.)
9781849514668
book jacket
版本 1st ed
說明 1 online resource (405 pages)
text txt rdacontent
computer c rdamedia
online resource cr rdacarrier
附註 Intro -- Python Testing Cookbook -- Table of Contents -- 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 assertFalse -- self.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 module -- How 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 edges -- How 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 -- How to do it... -- How it works... -- Running doctests from the command line -- How to do it... -- How it works... -- Coding a test harness for doctest -- How to do it... -- How it works... -- There's more... -- Filtering out test noise -- How to do it... -- How it works... -- There's more... -- Printing out all your documentation including a status report -- How to do it... -- How it works... -- There's more... -- Testing the edges -- How to do it... -- How it works... -- There's more... -- See also -- Testing corner cases by iteration -- How to do it... -- How it works..
Does this type of test fit better into doctest or unittest? -- See also -- Getting nosy with doctest -- Getting ready -- How to do it... -- How it works... -- See also -- Updating the project-level script to run this chapter's doctests -- How to do it... -- How it works... -- There's more -- See also -- 4. Testing Customer Stories with Behavior Driven Development -- Introduction -- Naming tests that sound like sentences and stories -- Getting ready -- How to do it... -- How it works... -- There's more -- The plugin isn't installable -- See also -- Testing separate doctest documents -- Getting ready -- How to do it... -- How it works... -- There's more... -- Doesn't this defy the usability of docstrings? -- Writing a testable story with doctest -- Getting ready -- How to do it... -- How it works... -- There's more... -- Writing a testable novel with doctest -- Getting ready -- How to do it... -- How it works... -- There's more... -- Writing a testable story with Voidspace Mock and nose -- Getting ready -- How to do it... -- How it works... -- There's more... -- Tell me more about the spec nose plugin! -- Why didn't we reuse the plugin from the recipe 'Naming tests so they sound like sentences and stories'? -- See also -- Writing a testable story with mockito and nose -- Getting ready -- How to do it... -- How it works... -- See also -- Writing a testable story with Lettuce -- Getting ready -- How to do it... -- How it works... -- There's more... -- How complex should a story be? -- Don't mix wiring code with application code -- Lettuce works great using folders -- See also -- Using Should DSL to write succinct assertions with Lettuce -- Getting ready -- How to do it... -- How it works... -- There's more... -- See also -- Updating the project-level script to run this chapter's BDD tests -- Getting ready -- How to do it... -- How it works... -- See also
5. High Level Customer Scenarios with Acceptance Testing -- Introduction -- Installing Pyccuracy -- How to do it... -- How it works... -- See also -- Testing the basics with Pyccuracy -- Getting ready -- How to do it... -- How it works... -- There's more... -- See also -- Using Pyccuracy to verify web app security -- Getting ready -- How to do it... -- How it works... -- See also -- Installing the Robot Framework -- How to do it... -- There's more... -- Creating a data-driven test suite with Robot -- Getting ready -- How to do it... -- How it works... -- There's more... -- Do I have to write HTML tables? -- What are the best ways to write the code that implements our custom keywords? -- Robot Framework variables are unicode -- See also -- Writing a testable story with Robot -- Getting ready -- How to do it... -- How it works... -- There's more... -- Given-When-Then results in duplicate rules -- Do the try-except blocks violate the idea of keeping things light? -- See also -- Tagging Robot tests and running a subset -- Getting ready -- How to do it... -- How it works... -- There's more... -- What about documentation? -- See also -- Testing web basics with Robot -- Getting ready -- How to do it... -- How it works... -- There's more... -- Learn about timing configurations-they may be important! -- See also -- Using Robot to verify web app security -- Getting ready -- How to do it... -- How it works... -- There's more... -- Why not use a 'remember me' option? -- Shouldn't we refactor the first test scenario to use the keyword? -- Would arguments make the login keyword more flexible? -- See also -- Creating a project-level script to verify this chapter's acceptance tests -- Getting ready -- How to do it... -- How it works... -- There's more... -- Can we only use getopt? -- What's wrong with using the various command-line tools?
6. Integrating Automated Tests with Continuous Integration -- Introduction -- Generating a continuous integration report for Jenkins using NoseXUnit -- Getting ready -- How to do it... -- How it works... -- Configuring Jenkins to run Python tests upon commit -- Getting ready -- How to do it... -- How it works... -- There's more... -- Do I have to use git for source code management? -- What is the format of polling? -- See also -- Configuring Jenkins to run Python tests when scheduled -- Getting ready -- How to do it... -- How it works... -- There's more... -- Jenkins versus TeamCity -- See also -- Generating a CI report for TeamCity using teamcity-nose -- Getting ready -- How to do it... -- How it works... -- Configuring TeamCity to run Python tests upon commit -- Getting ready -- How to do it... -- How it works... -- There's more... -- What did teamcity-nose give us? -- See also -- Configuring TeamCity to run Python tests when scheduled -- Getting ready -- How to do it... -- How it works... -- See also -- 7. Measuring your Success with Test Coverage -- Introduction -- Building a network management application -- How to do it... -- How it works... -- Installing and running coverage on your test suite -- How to do it... -- There's more... -- Why are there no asserts in the unit test? -- Generating an HTML report using coverage -- How to do it… -- How it works... -- Generating an XML report using coverage -- How to do it… -- How it works... -- What use is an XML report? -- See also -- Getting nosy with coverage -- How to do it... -- How it works... -- There's more... -- Why use the nose plugin instead of the coverage tool directly? -- Why are sqlite3 and springpython included? -- Filtering out test noise from coverage -- How to do it... -- How it works... -- There's more... -- See also -- Letting Jenkins get nosy with coverage -- Getting ready
How to do it..
Over 70 simple but incredibly effective recipes for taking control of automated testing using powerful Python testing tools
Description based on publisher supplied metadata and other sources
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2020. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries
鏈接 Print version: Turnquist, Greg L. Python Testing Cookbook Olton : Packt Publishing, Limited,c2011 9781849514668
主題 Molecular biology.;Proteins -- Structure
Electronic books
Record:   Prev Next