Changes between Initial Version and Version 4 of Ticket #24714


Ignore:
Timestamp:
Apr 27, 2015, 10:14:16 AM (10 years ago)
Author:
Alasdair Nicol
Comment:

As mentioned by Tim on the pull request, it is not always appropriate to use self.assertTrue and self.assertFalse, as these will pass for truthy and falsey values. I have updated the ticket description and pull request.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24714

    • Property Owner changed from nobody to Alasdair Nicol
    • Property Status newassigned
    • Property Has patch set
    • Property Component UncategorizedCore (Other)
    • Property Patch needs improvement set
    • Property Triage Stage UnreviewedAccepted
    • Property Type UncategorizedCleanup/optimization
  • Ticket #24714 – Description

    initial v4  
    22
    33{{{
    4 self.assertEqual(True, x)  # prefer self.assertTrue(x)
    5 self.assertEqual(False, x)  # prefer self.assertFalse(x)
    64self.assertEqual(None, x)  # prefer self.assertIsNone(x)
    75self.assertEqual(True, x in y) # prefer self.assertIn(x, y)
     6
     7
     8self.assertEqual(True, x)  # self.assertTrue(x) may be appropriate, but care is needed because it will pass for truthy values
     9self.assertEqual(False, x)  # prefer self.assertFalse(x) may be appropriate, but care is needed because it will pass for falsey values
    810self.assertEqual(True, x == y) # prefer self.assertEqual(x, y)
    9 self.assertEqual(False, x == y) # prefer self.assertNotEqual(x, y)
    1011}}}
    1112
Back to Top