如何扩展和修改 PyUnit

发布于 2024-08-02 12:42:19 字数 138 浏览 5 评论 0原文

我即将开始扩展和修改 PyUnit。 例如,除了失败之外,我还会向其添加警告。

我有兴趣听听有关如何开始的建议, 例如,子类化每个 PyUnit 类? 应避免什么以及其他注意事项。

寻找那些已经扩展了 PyUnit 的人的输入。

I'm about to embark upon extending and modifying PyUnit.
For instance, I will add warnings to it, in addition to failures.

I'm interested in hearing words of advice on how to start,
for instance, subclass every PyUnit class?
What to avoid and misc caveats.

Looking for input from those that have extended PyUnit already.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若水微香 2024-08-09 12:42:19

我建议学习 nose 项目,这是一个流行且设计良好的 PyUnit 扩展。您可以在此处在线浏览其来源,或者在您的网站上获取副本机器通过 Mercurial,又名 hg,一个很好的分布式版本控制系统which nose 将其源代码保留在 Google 代码托管上。

您可能很不同意nose的一些设计决策,但总的来说,他们在这些决策上执行得很好,因此即使您决定您的扩展将完全投入使用,源代码仍然值得研究不同的方向。

I recommend studying the nose project, a popular and well designed extension of PyUnit. You can browse its sources online here or get a copy on your machine via Mercurial, aka hg, a nice distributed version control system in which nose keeps its sources on Google Code Hosting.

You may well disagree with some of nose's design decisions, but in general they have executed very well on those decisions, so the sources are worth studying anyway even if you decide that your extension will go in completely different directions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文