摘要:
计算机其实是不认识十进制数,它只认识二进制数,也就是说,当我们以十进制数进行运算的时候,计算机需要将各个十进制数转换成二进制数,然后进行二进制间的计算。如进行浮点数金额计算时会出现如下错误: class TestAdd: def test_add_01(self): assert 0.1 + 0.2 阅读全文
摘要:
一、配置文件设置选项 使用pytest --help指令可以查看pytest.ini的设置选项 pytest -h 结果: [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found: markers (line 阅读全文
摘要:
如果您有一个运行缓慢的大型测试套件,您可能希望找出哪些测试是最慢的。让我们创建一个人工测试套件: import time class TestSlow: def test_funcfast(self): time.sleep(0.1) def test_funcslow1(self): time.s 阅读全文