]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
better logging when matches aren't working.
authorIvan Malison <IvanMalison@gmail.com>
Thu, 25 Sep 2014 11:49:00 +0000 (04:49 -0700)
committerIvan Malison <IvanMalison@gmail.com>
Thu, 25 Sep 2014 11:49:00 +0000 (04:49 -0700)
vcr/matchers.py

index 4964b9fcf0e51e1e62fd7471f727b4366cad81be..d24875cd398fc45853d965d7afca7a53f3910691 100644 (file)
@@ -38,16 +38,16 @@ def headers(r1, r2):
     return r1.headers == r2.headers
 
 
-def _log_matches(matches):
+def _log_matches(r1, r2, matches):
     differences = [m for m in matches if not m[0]]
     if differences:
         log.debug(
-            'Requests differ according to the following matchers: ' +
-            str(differences)
+            "Requests {0} and {1} differ according to "
+            "the following matchers: {2}".format(r1, r2, differences)
         )
 
 
 def requests_match(r1, r2, matchers):
     matches = [(m(r1, r2), m) for m in matchers]
-    _log_matches(matches)
+    _log_matches(r1, r2, matches)
     return all([m[0] for m in matches])