Python中的单元测试

编程入门 行业动态 更新时间:2024-10-11 21:23:16
本文介绍了Python中的单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我最近一直在阅读一些关于Python单元测试的文章 [1] [2],但我有点困惑:我在哪里开始使用 这个?我试着谷歌搜索unittest但我找到的只是一些旧的 链接到已经使用它的项目,而旧的(如文章 所说)PyUnit项目。我很抱歉,如果这是一个明显的问题,或者已经回答了一个 ,但是单元测试听起来很有趣并且 我不知道在哪里开始。 谢谢, Ryan Kaulakis

Hi Everyone, I''ve recently been reading some articles about unit-testing in Python [1] [2], but I am a bit confused: where do I go to get started with this? I tried googling for "unittest" but all I''ve found are some old links to projects that already use it, and the older (as the articles put it) PyUnit project. I''m sorry if this is a obvious question or one that has already been answered, but unit-testing sounds interesting and I''m not sure where to start. Thanks, Ryan Kaulakis

推荐答案

在文章< 11 ********************** @ o13g2000cwo.googlegroups > ;, " rhat" < FA ******* @ gmail>写道: In article <11**********************@o13g2000cwo.googlegroups >, "rhat" <fa*******@gmail> wrote: 大家好,我最近在读一些关于Python单元测试的文章 [1] [2],但我是有点困惑:我在哪里开始使用这个?我试着谷歌搜索unittest但是我找到的只是已经使用它的项目的旧链接,以及较旧的(如文章所述)PyUnit项目。我很抱歉,如果这是一个明显的问题,或者已经得到解答的问题,但是单元测试听起来很有趣,而且我不知道从哪里开始。 Ryan Kaulakis Hi Everyone, I''ve recently been reading some articles about unit-testing in Python [1] [2], but I am a bit confused: where do I go to get started with this? I tried googling for "unittest" but all I''ve found are some old links to projects that already use it, and the older (as the articles put it) PyUnit project. I''m sorry if this is a obvious question or one that has already been answered, but unit-testing sounds interesting and I''m not sure where to start. Thanks, Ryan Kaulakis

PyUnit确实是我用的。它包含在当前的发行版中,如 " unittest"模块。 模块文档并不完美(特别是当涉及到大的 图片时),但是有一个很好的教程 diveintopython/unit_testing/index.html 一旦你了解它是如何工作的,那么 的使用真的很简单。它还有一个优势,是不同语言(Junit,C ++单位等)的一系列X-unit 包中的一个,它们都有 同一组织(针对特定语言的津贴 要求)。这意味着一旦你学会了一个,你就有了一个大脑袋 开始学习另一个。

PyUnit is indeed what I use. It''s included in current distributions as the "unittest" module. The module docs aren''t perfect (especially when it comes to the big picture), but there''s a good tutorial at diveintopython/unit_testing/index.html Once you get your head around how it works, it''s really quite simple to use. It also has the advantage of being one of a series of "X-unit" packages for different languages (Junit, C++Unit, etc) which all have the same organization (with allowances made for language-specific requirements). This means once you''ve learned one, you''ve got a big head start one learning another one.

整齐的原始海报显示为一个潜在的网络钓鱼者,在gmail中有一个很好的 大红色警告。 由于一些时髦的标题伪造。 不要给他们你的SSN。 :) 我有一个相关的问题。什么是PyDoc?我看到它出现了很多 搜索单元测试和python,但我从来没有找到 找出原因。 也许我现在就会这样做。 2005年2月10日星期四21:34:06 -0500,Roy Smith< ro*@panix>写道: Neat the original poster shows up as a potential Phisher with a nice big red warning in gmail. Due to some funky header fakedness. Don''t give them your SSN. :) I have a related question. What is PyDoc? I see it come up alot in searches for Unit testing and python, but I''ve never gotten around to finding out why. Maybe I''ll do that now. On Thu, 10 Feb 2005 21:34:06 -0500, Roy Smith <ro*@panix> wrote: 在文章< 11 ********************** @ o13g2000cwo.googlegroups >, ; RHAT" < FA ******* @ gmail>写道: In article <11**********************@o13g2000cwo.googlegroups >, "rhat" <fa*******@gmail> wrote: 大家好,我最近在读一些关于Python单元测试的文章 [1] [2],但我是有点困惑:我在哪里开始使用这个?我试着谷歌搜索unittest但是我找到的只是已经使用它的项目的旧链接,以及较旧的(如文章所述)PyUnit项目。我很抱歉,如果这是一个明显的问题,或者已经得到解答的问题,但是单元测试听起来很有趣,而且我不知道从哪里开始。 Ryan Kaulakis Hi Everyone, I''ve recently been reading some articles about unit-testing in Python [1] [2], but I am a bit confused: where do I go to get started with this? I tried googling for "unittest" but all I''ve found are some old links to projects that already use it, and the older (as the articles put it) PyUnit project. I''m sorry if this is a obvious question or one that has already been answered, but unit-testing sounds interesting and I''m not sure where to start. Thanks, Ryan Kaulakis

PyUnit确实是我用的。它包含在当前的发行版中作为unittest。模块。 模块文档并不完美(特别是当涉及到大图片时),但有一个很好的教程 diveintopython/unit_testing/index.html 一旦你了解它是如何工作的,它的使用真的很简单。它还具有作为一系列用于不同语言(Junit,C ++单元等)的X-unit包之一的优点,它们都具有相同的组织(具有许可)针对特定语言的要求)。这意味着一旦你学会了一个,你就会有一个大脑袋开始学习另一个。 - mail.python/mailman/listinfo/python-list

- Thomas G. Willis http:/ / paperbackmusic

是的,你知道我只会询问有关测试驱动开发的问题 基础知识,希望能够获得你的个人信息,以便我可以在Molodovian blackmarket上卖掉它。我不是一个网络钓鱼者,我是一个非常懒惰的人,他懒得去挖掘他自己的答案。 ;) 感谢您的帮助Roy,我不确定 unittest和pyunit之间有什么区别。 - | 2 \ | / -\ | \ | |< / - \ | _ || _ / - \ |< 15(我的 超级秘密的超级网络钓鱼别名,这恰好是我的实际情况 名字) PS:是的,我也很担心为什么gmail允许我注册 " fakeadmin"作为登录。当然可以开始很好的对话。 = P Yeah, you know I only ask questions about Test-driven development basics in hopes of obtaining your personal information, so that I can sell it on the Molodovian blackmarket. I''m not a "Phisher", I''m a comp-sci major who''s too lazy to dig around for his own answers. ;) Thanks for your help Roy, I wasn''t sure what the difference between unittest and pyunit were. --|2 \| /-\ |\| |</-\|_||_/-\|<15 (the uber-l33t version of my supersecret "phishing" alias which just so happens to be my actual name) PS: Yeah, I too am plerplexed as to why gmail allowed me to register "fakeadmin" as a login. Sure makes a good conversation started though. =P

更多推荐

Python中的单元测试

本文发布于:2023-11-24 02:25:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元测试   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!