From a43bb4f25559c5fe2f57183d70a041a78b596185 Mon Sep 17 00:00:00 2001 From: Pavel Minaev Date: Sun, 14 Oct 2018 18:19:05 -0700 Subject: [PATCH] Add more test diagnostic output for expectation testing. --- pytests/helpers/timeline.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pytests/helpers/timeline.py b/pytests/helpers/timeline.py index 10057034..819620b9 100644 --- a/pytests/helpers/timeline.py +++ b/pytests/helpers/timeline.py @@ -190,9 +190,23 @@ class Timeline(object): # First time wait_until() calls us, we have to check the whole timeline. # On subsequent calls, we only need to check the newly added occurrence. if check_past: + if explain: + print( + colors.LIGHT_MAGENTA + 'Testing ' + colors.RESET + + colors.color_repr(expectation) + + colors.LIGHT_MAGENTA + ' against timeline up to and including ' + colors.RESET + + colors.color_repr(self.last) + ) reasons.update(expectation.test_at_or_before(self.last) or {}) del check_past[:] else: + if explain: + print( + colors.LIGHT_MAGENTA + 'Testing ' + colors.RESET + + colors.color_repr(expectation) + + colors.LIGHT_MAGENTA + ' against ' + colors.RESET + + colors.color_repr(self.last) + ) reasons.update(expectation.test_at(self.last) or {}) if reasons: