IF YOU HAVE picked up this book, you clearly have some interest in the world of Python. Perhaps you have just started to learn the language. Maybe you have some Python experience and are looking to learn more about the world of testing. You also could have many years of Python under your belt and want to refresh your testing skills. Whatever your reasons, you will pick up some new skills.
The book covers testing right through from its history looking at how testing in Python has evolved over the years to where it is now, and a brief look at the different practices used. You also look at reasons for testing and why it can be so important in both large enterprise class projects and in small personal projects.
The book lets you get your hands dirty with the basic building blocks in testing, which are unit tests. Here you will be taken through what a unit test is, the basic syntax, and examples of a simple unit test. Then, you take a comprehensive look at the methods available to use in unit testing and the various tools available to help in running and debugging your tests. Wrapping up the unit test section, you look into the pivotal use of mocks and patching, which allow you to isolate the code you are interested in testing (your â€œunitsâ€), and simulate responses from other parts of the system or libraries.
Testing in your documentation is one of the more interesting parts of Python testing. This section shows you how to effectively embed unit tests in your doc strings and have them run as tests. Here you look at why this might be useful to you and go through some examples on writing these yourself.
Your attention then turns to the more recent hot topic of test driven development (TDD), a practice which if followed correctly can ensure you deliver great code that does exactly what you need it to the first time. The TDD section introduces the concepts and ethos of the practice and covers steps required to adopt it. I provide great use cases using TDD in pair programming and show how you can make the development process more fun. Wrapping up the section are examples of test-driving the creation of a part of a real application that you can try yourself.
|May 30, 2020
How to Read and Open File Type for PC ?