Python Testing with pytest

This book shows you how. For Python-based projects, pytest is the undeniable choice to test your code if you're looking for a full-featured, API-independent, flexible, and extensible testing framework.

Python Testing with pytest

Author: Brian Okken

Publisher: Pragmatic Bookshelf

ISBN: 1680504401

Page: 222

View: 857

Do less work when testing your Python code, but be just as expressive, just as elegant, and just as readable. The pytest testing framework helps you write tests quickly and keep them readable and maintainable - with no boilerplate code. Using a robust yet simple fixture model, it's just as easy to write small tests with pytest as it is to scale up to complex functional testing for applications, packages, and libraries. This book shows you how. For Python-based projects, pytest is the undeniable choice to test your code if you're looking for a full-featured, API-independent, flexible, and extensible testing framework. With a full-bodied fixture model that is unmatched in any other tool, the pytest framework gives you powerful features such as assert rewriting and plug-in capability - with no boilerplate code. With simple step-by-step instructions and sample code, this book gets you up to speed quickly on this easy-to-learn and robust tool. Write short, maintainable tests that elegantly express what you're testing. Add powerful testing features and still speed up test times by distributing tests across multiple processors and running tests in parallel. Use the built-in assert statements to reduce false test failures by separating setup and test failures. Test error conditions and corner cases with expected exception testing, and use one test to run many test cases with parameterized testing. Extend pytest with plugins, connect it to continuous integration systems, and use it in tandem with tox, mock, coverage, unittest, and doctest. Write simple, maintainable tests that elegantly express what you're testing and why. What You Need: The examples in this book are written using Python 3.6 and pytest 3.0. However, pytest 3.0 supports Python 2.6, 2.7, and Python 3.3-3.6.

Related Books:

Testing Python
Language: un
Pages: 240
Authors: David Sale
Categories: Computers
Type: BOOK - Published: 2014-07-03 - Publisher: John Wiley & Sons

Fundamental testing methodologies applied to the popular Pythonlanguage Testing Python; Applying Unit Testing, TDD, BDD andAcceptance Testing is the most comprehensive book available ontesting for one of the top software programming languages in theworld. Python is a natural choice for new and experienceddevelopers, and this hands-on resource is a much
Python Testing with pytest
Language: un
Pages: 222
Authors: Brian Okken
Categories: Computers
Type: BOOK - Published: 2017-09-15 - Publisher: Pragmatic Bookshelf

Do less work when testing your Python code, but be just as expressive, just as elegant, and just as readable. The pytest testing framework helps you write tests quickly and keep them readable and maintainable - with no boilerplate code. Using a robust yet simple fixture model, it's just as
Python Unit Test Automation
Language: un
Pages: 111
Authors: Ashwin Pajankar
Categories: Computers
Type: BOOK - Published: 2017-02-23 - Publisher: Apress

Quickly learn how to automate unit testing of Python 3 code with Python 3 automation libraries, such as doctest, unittest, nose, nose2, and pytest. This book explores the important concepts in software testing and their implementation in Python 3 and shows you how to automate, organize, and execute unit tests
Testing in Python
Language: un
Pages: 177
Authors: Alfredo Deza, Noah Gift
Categories: Computers
Type: BOOK - Published: 2020-02-27 - Publisher:

Getting started with testing can be hard, and this book aims make it all very easy by using examples and explaining the process in a straightforward way. Testing is a core principle of robust software implementations and should be a prime skill to master that can be applied to any
Effective Python Penetration Testing
Language: en
Pages: 164
Authors: Rejah Rehim
Categories: Computers
Type: BOOK - Published: 2016-06-29 - Publisher: Packt Publishing Ltd

Pen test your system like a pro and overcome vulnerabilities by leveraging Python scripts, libraries, and tools About This Book Learn to utilize your Python scripting skills to pentest a computer system, network, and web-application Get proficient at the art of assessing vulnerabilities by conducting effective penetration testing This is