Opened 3 years ago

Last modified 3 years ago

#5173 enhancement new

trial should support a assertNotUnequal method

Reported by: cyli Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: jml, ivank-twisted-bugs@… Branch:
Author: Launchpad Bug:

Description

assertEqual and assertEquals tests the __eq__ method. It would be useful to have a method to test that __ne__ correctly returns false for equal objects.

Change History (3)

comment:1 Changed 3 years ago by DefaultCC Plugin

  • Cc jml added

comment:2 Changed 3 years ago by ivank

  • Cc ivank-twisted-bugs@… added

What do you think about having an assert method that tests both ==, not !=, and cmp at the same time? I noticed that right now you're writing tests where assertEqual and assertNotUnequal are essentially duplicated. Having an assert method that does both would make things less redundant.

I have an assertReallyEqual and assertReallyNotEqual in http://ludios.org/ivank/2010/10/testing-your-eq-ne-cmp/ , but of course the implementation in Twisted could be different.

comment:3 Changed 3 years ago by exarkun

twisted.python.test.test_util.EqualityTests might have some ideas to incorporate into a general helper.

Note: See TracTickets for help on using tickets.