Way too many slashes in MatchesRegex mismatch

Bug #818079 reported by Jonathan Lange
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Wishlist
Jonathan Lange

Bug Description

e.g.

AssertionError: '' does not match '\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d,\\d\\d\\d - INFO - first\\n\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d,\\d\\d\\d - INFO - second\\n'

=== modified file 'testtools/matchers.py'
--- testtools/matchers.py 2011-07-27 19:47:22 +0000
+++ testtools/matchers.py 2011-07-29 14:26:48 +0000
@@ -730,7 +730,7 @@ class MatchesRegex(object):

     def match(self, value):
         if not re.match(self.pattern, value, self.flags):
- return Mismatch("%r does not match %r" % (value, self.pattern))
+ return Mismatch("%r does not match %s" % (value, self.pattern))

 class MatchesSetwise(object):

probably fixes it.

Related branches

Jonathan Lange (jml)
Changed in testtools:
assignee: nobody → Jonathan Lange (jml)
status: Triaged → In Progress
Jonathan Lange (jml)
Changed in testtools:
status: In Progress → Fix Committed
milestone: none → next
Jonathan Lange (jml)
Changed in testtools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.