没有合适的资源?快使用搜索试试~ 我知道了~
首页Python初学者指南:轻松上手项目测试
"《Python测试入门指南》是一本专为初学者设计的Python编程测试教程。作者Daniel Arbuckle以简单易懂的方式引导读者深入了解如何有效地测试他们的Python项目。本书由Packt Publishing出版,版权日期为2010年1月,强调了在未经许可的情况下,任何部分内容均不得复制、存储或通过任何形式传播,除非用于学术引用。 书中内容覆盖了Python测试的基础概念,包括但不限于单元测试、集成测试、测试框架(如unittest和pytest)、代码覆盖率分析以及持续集成/持续部署(CI/CD)的最佳实践。它详细介绍了如何编写可读性强、易于维护的测试代码,以及如何利用测试驱动开发(TDD)和行为驱动开发(BDD)方法提升软件质量。 作者强调了在编写代码的同时进行测试的重要性,并提供了一些实用的技巧和策略,帮助读者避免常见的陷阱,如写出无效测试、测试代码冗余和忽视边界条件。此外,书中还探讨了如何处理测试中的错误和失败情况,以及如何与团队协作,确保测试的全面性和一致性。 《Python测试入门指南》不仅适合初学者快速上手,也适合有一定经验的开发者巩固和扩展他们的测试知识,以便在实际项目中提高软件质量和开发效率。由于信息可能随着时间的推移有所更新,因此读者在使用时应结合最新技术和实践,以保持最佳实践的时效性。这是一本实用且富有指导意义的资源,对于Python开发者进行有效测试工作具有重要的参考价值。"
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/3975233/bg10.jpg)
Preface
Like any programmer, you need to be able to produce reliable code that conforms to a
specicaon, which means that you need to test your code. In this book, you'll learn how to
use techniques and Python tools that reduce the eort involved in tesng, and at the same
me make it more useful—and even fun.
You'll learn about several of Python's automated tesng tools, and you'll learn about the
philosophies and methodologies that they were designed to support, like unit tesng and
test-driven development. When you're done, you'll be able to produce thoroughly tested
code faster and more easily than ever before, and you'll be able to do it in a way that doesn't
distract you from your "real" programming.
What this book covers
Chapter 1: Tesng for Fun and Prot introduces Python test-driven development and various
tesng methods.
Chapter 2: Doctest: The Easiest Tesng Tool covers the doctest tool and teaches you how
to use it.
Chapter 3: Unit Tesng with Doctest introduces the ideas of unit tesng and test-driven
development, and applies doctest to create unit tests.
Chapter 4: Breaking Tight Coupling by using Mock Objects covers mock objects and the
Python Mocker tool.
Chapter 5: When Doctest isn't Enough: Uniest to the Rescue introduces the uniest
framework and discusses when it is preferred over doctest.
Chapter 6: Running Your Tests: Follow Your Nose introduces the Nose test runner, and
discusses project organizaon.
![](https://csdnimg.cn/release/download_crawler_static/3975233/bg11.jpg)
Preface
[ 2 ]
Chapter 7: Developing a Test-Driven Project walks through a complete test-driven
development process.
Chapter 8: Tesng Web Applicaon Frontends using Twill applies the knowledge gained from
previous chapters to web applicaons, and introduces the Twill tool.
Chapter 9: Integraon Tesng and System Tesng teaches how to build from unit tests to
tests of a complete soware system.
Chapter 10: Other Tesng Tools and Techniques introduces code coverage and connuous
integraon, and teaches how to e automated tesng into version control systems.
Appendix: Answers to Pop Quizes contains the answers to all pop quizes, chapter-wise.
What you need for this book
To use this book, you will need a working Python interpreter, preferably one of the 2.6 version
series. You'll also need a source code editor, and occasional access to the internet. You will
need to be comfortable enough using your operang system's textual interface—your DOS
prompt or command shell—to do basic directory management and to run programs.
Who this book is for
If you are a Python developer and want to write tests for your applicaons, this book will get
you started and show you the easiest way to learn tesng.
You need to have sound Python programming knowledge to follow along. An awareness of
soware tesng would be good, but no formal knowledge of tesng is expected nor do you
need to have any knowledge of the libraries discussed in the book.
Conventions
In this book, you will nd several headings appearing frequently.
To give clear instrucons of how to complete a procedure or task, we use:
Time for action – heading
1. Acon 1
2. Acon 2
3. Acon 3
![](https://csdnimg.cn/release/download_crawler_static/3975233/bg12.jpg)
Preface
[ 3 ]
Instrucons oen need some extra explanaon so that they make sense, so they are
followed with:
What just happened?
This heading explains the working of tasks or instrucons that you have just completed.
You will also nd some other learning aids in the book, including:
Pop quiz – heading
These are short mulple choice quesons intended to help you test your own understanding.
Have a go hero – heading
These set praccal challenges and give you ideas for experimenng with what you
have learned.
You will also nd a number of styles of text that disnguish between dierent kinds of
informaon. Here are some examples of these styles, and an explanaon of their meaning.
Code words in text are shown as follows: "We can include other contexts through the use
of the include direcve."
A block of code is set as follows:
... if node.right is not None:
... assert isinstance(node.right, AVL)
... assert node.right.key > node.key
... right_height = node.right.height + 1
When we wish to draw your aenon to a parcular part of a code block, the relevant lines
or items are set in bold:
... if node.right is not None:
... assert isinstance(node.right, AVL)
... assert node.right.key > node.key
... right_height = node.right.height + 1
![](https://csdnimg.cn/release/download_crawler_static/3975233/bg13.jpg)
Preface
[ 4 ]
Any command-line input or output is wrien as follows:
# cp /usr/src/asterisk-addons/configs/cdr_mysql.conf.sample
/etc/asterisk/cdr_mysql.conf
New terms and important words are shown in bold. Words that you see on the screen, in
menus or dialog boxes for example, appear in the text like this: "clicking the Next buon
moves you to the next screen".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or may have disliked. Reader feedback is important for us to develop
tles that you really get the most out of.
To send us general feedback, simply send an email to feedback@packtpub.com, and
menon the book tle via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the
SUGGEST A TITLE form on www.packtpub.com or email suggest@packtpub.com.
If there is a topic that you have experse in and you are interested in either wring or
contribung to a book on, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.
Downloading the example code for the book
Visit http://www.packtpub.com/files/code/8846_Code.zip to
directly download the example code.
The downloadable les contain instrucons on how to use them.
![](https://csdnimg.cn/release/download_crawler_static/3975233/bg14.jpg)
Preface
[ 5 ]
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you nd a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you would report this to us. By doing so, you can save other
readers from frustraon, and help us to improve subsequent versions of this book. If you
nd any errata, please report them by vising hp://www.packtpub.com/support, selecng
your book, clicking on the let us know link, and entering the details of your errata. Once
your errata are veried, your submission will be accepted and the errata added to any
list of exisng errata. Any exisng errata can be viewed by selecng your tle from
http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt,
we take the protecon of our copyright and licenses very seriously. If you come across any
illegal copies of our works, in any form, on the Internet, please provide us with the locaon
address or web site name immediately so that we can pursue a remedy.
Please contact us at copyright@packtpub.com with a link to the suspected
pirated material.
We appreciate your help in protecng our authors, and our ability to bring you
valuable content.
Questions
You can contact us at questions@packtpub.com if you are having a problem with any
aspect of the book, and we will do our best to address it.
剩余255页未读,继续阅读
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/50deea9a76b54efa934068fd8bf17ee9_linghu9990.jpg!1)
towriting
- 粉丝: 11
- 资源: 48
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- Hadoop生态系统与MapReduce详解
- MDS系列三相整流桥模块技术规格与特性
- MFC编程:指针与句柄获取全面解析
- LM06:多模4G高速数据模块,支持GSM至TD-LTE
- 使用Gradle与Nexus构建私有仓库
- JAVA编程规范指南:命名规则与文件样式
- EMC VNX5500 存储系统日常维护指南
- 大数据驱动的互联网用户体验深度管理策略
- 改进型Booth算法:32位浮点阵列乘法器的高速设计与算法比较
- H3CNE网络认证重点知识整理
- Linux环境下MongoDB的详细安装教程
- 压缩文法的等价变换与多余规则删除
- BRMS入门指南:JBOSS安装与基础操作详解
- Win7环境下Android开发环境配置全攻略
- SHT10 C语言程序与LCD1602显示实例及精度校准
- 反垃圾邮件技术:现状与前景
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)