pytest断言
1、使用 ==、!=、<、>、>=、<=
2、使用in和not in来测试包含或不包含
3、使用true或false
class TestAssert: def test_assert(self): # ==,!=,>,<,>=,<= assert 'william' == 'william' assert 'william-a' != 'william-b' assert 0 < 1 assert 2 > 1 assert 3 <= 7 - 2 assert 4 >= 1 + 2 # 包含和不包含 assert 'william' in 'william-UI_test' assert 'william' not in 'UI_test' # true和false assert 1 assert 9==10 is True assert not False assert not True
标签:william,断言,包含,assert,pytest,test From: https://www.cnblogs.com/purewhite/p/17222144.html