assertEquals vs. assertEqual in python

前端 未结 5 1750
北荒
北荒 2020-12-23 08:21

Is there a difference between assertEquals and assertEqual in the python unittest.TestCase?

And if there is not, why are there

5条回答
  •  悲哀的现实
    2020-12-23 08:58

    I think this was tension between the "only one obvious way to do it" vs. "alias to make the overall code flow semantically". Personally I found I like to read

    failIf(some_condition)
    

    over

    assertFalse(some_condition)
    

    but liked

    assertEqual(a, b)
    

    over the other two (assertEquals(a, b) bothers my sense of grammar).

    The "only one obvious way to do it" has taken precedence going forward.

提交回复
热议问题