← Back to team overview

testtools-dev team mailing list archive

[Merge] lp:~allenap/testtools/lessthan-mismatch-string into lp:testtools

 

Gavin Panella has proposed merging lp:~allenap/testtools/lessthan-mismatch-string into lp:testtools.

Requested reviews:
  testtools developers (testtools-dev)

For more details, see:
https://code.launchpad.net/~allenap/testtools/lessthan-mismatch-string/+merge/57323

The other _BinaryComparison subclasses - Equals, NotEquals, Is - give
mismatch messages that describe the problem. LessThan gives a mismatch
message that appears to describe the test... except that it doesn't.

Presently it'll say things like:

   44 is >= 55
   12 is >= 12

I've changed it to say:

   44 is not > 55
   12 is not > 12

-- 
https://code.launchpad.net/~allenap/testtools/lessthan-mismatch-string/+merge/57323
Your team testtools developers is requested to review the proposed merge of lp:~allenap/testtools/lessthan-mismatch-string into lp:testtools.
=== modified file 'testtools/matchers.py'
--- testtools/matchers.py	2011-04-01 14:09:24 +0000
+++ testtools/matchers.py	2011-04-12 13:57:32 +0000
@@ -290,7 +290,7 @@
     """Matches if the item is less than the matchers reference object."""
 
     comparator = operator.__lt__
-    mismatch_string = 'is >='
+    mismatch_string = 'is not >'
 
 
 class MatchesAny(object):

=== modified file 'testtools/tests/test_matchers.py'
--- testtools/tests/test_matchers.py	2011-04-01 14:09:24 +0000
+++ testtools/tests/test_matchers.py	2011-04-12 13:57:32 +0000
@@ -168,7 +168,7 @@
         ("LessThan(12)", LessThan(12)),
         ]
 
-    describe_examples = [('4 is >= 4', 4, LessThan(4))]
+    describe_examples = [('4 is not > 4', 4, LessThan(4))]
 
 
 def make_error(type, *args, **kwargs):


Follow ups