代码拉取完成,页面将自动刷新
import pytest
import math
class TestPow:
# pytest 参数化
@pytest.mark.parametrize(
"base,exponent,expected",
[(2, 2, 4), (3, 3, 27), (1, 9, 1), (0, 9, 0)],
ids=["case1", "case2", "case3", "case4"])
def test_pow(self,base, exponent, expected):
print(base, exponent, expected)
assert math.pow(base, exponent) == expected
@pytest.mark.parametrize(
"ip,port,ip2,port2",
[("192.1.168.666", 13400,"192.168.1.1" ,0x456), ("192.1.168.666", 13,"192.168.1.1" ,0x456),
("192.1.168.666", 13400,"192.168.1.1" ,0x46), ("192.1.168.666", 134,"192.168.1.1" ,0x8888)],
ids=["case1", "case2", "case3", "case4"])
def test_1(self,ip,port,ip2,port2):
print(ip,port,ip2,port2)
if __name__ == '__main__':
pytest.main(['-sv'])
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。