← Back to team overview

testtools-dev team mailing list archive

[Bug 704219] Re: wish for invertible matchers

 

FWIW, Hamcrest (Java) matchers append to a description, which might make
this easier.

<http://www.google.com/codesearch#nmwoqoPm7yk/hamcrest-java/hamcrest-
core/src/main/java/org/hamcrest/core/IsNot.java>

(Also, just discovered that there is a hamcrest Python port maintained
by the hamcrest folk. Rather irritated by the news.)

-- 
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.
https://bugs.launchpad.net/bugs/704219

Title:
  wish for invertible matchers

Status in testtools:
  Triaged

Bug description:
  I can define ContainsRegexp(r'\d+') and match against it, and then
  also say Not(ContainsRegexp(r'\d+')) and this works. However, in the
  latter case, what I'd really like to get is something like

    "unexpectedly matched '\\d+' in 'route66' at '66'"

  rather than just being told the matcher passed successfully.

  I can just define NotContainsRegexp that has the same behavior but
  gives better mismatches.  But I wonder if this should fall out in a
  cleaner way.

To manage notifications about this bug go to:
https://bugs.launchpad.net/testtools/+bug/704219/+subscriptions


References