From: Ivan Malison Date: Thu, 25 Sep 2014 11:49:00 +0000 (-0700) Subject: better logging when matches aren't working. X-Git-Tag: v1.1.2~9 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=2c6f072d11dd74a80a7f7751b70305a765921828;p=vcrpy.git better logging when matches aren't working. --- diff --git a/vcr/matchers.py b/vcr/matchers.py index 4964b9f..d24875c 100644 --- a/vcr/matchers.py +++ b/vcr/matchers.py @@ -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])