标签: pyhamcrest

为什么 PyHamcrest 没有负等式匹配器?

回顾PyHamcrest 的 API,我发现有一个equal_to匹配器

from hamcrest import *
assert_that('1', equal_to('1'))
Run Code Online (Sandbox Code Playgroud)

但没有并行的否定方法,例如not_equal_to

from hamcrest import *
assert_that('1', not_equal_to('2'))
Run Code Online (Sandbox Code Playgroud)

匹配负相等的正确方法是什么?

python equals hamcrest pyhamcrest

1
推荐指数
1
解决办法
1175
查看次数

标签 统计

equals ×1

hamcrest ×1

pyhamcrest ×1

python ×1