test_trapz.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:IntroPython2016 作者: UWPCE-PythonCert 项目源码 文件源码
def test_sine2():
    #  a sine curve from zero to 2pi -- should be 0.0
    # need to set an absolute tolerance when comparing to zero
    assert isclose(trapz(math.sin, 0, 2*math.pi), 0.0, abs_tol=1e-8)


# test the quadratic function itself
#   this is pytest's way to test a bunch of input and output values
#   it creates a separate test for each case.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号