跳转到主要内容

unittest的Jasmine样式断言

项目描述

Chamomile让在Python单元测试中进行断言变得更加愉快。它大量借鉴了Jasmine的断言语法。看看这里

import chamomile

class ExampleTest(chamomile.Test):
    def test_simple_assertions(self):
        self.expect(12).to_equal(12)
        self.expect(False).to_not_be(0)

        with self.expect(ZeroDivsionError):
            4 / 0

您可以在源代码中轻松浏览所有可用的断言列表。

由以下赞助

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面