29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
From b9c17412445530298eb28917c1ef3a8f7cff971c Mon Sep 17 00:00:00 2001
|
|
From: Brandon Hong <brandon.hong@intel.com>
|
|
Date: Wed, 9 Oct 2019 15:18:56 +0800
|
|
Subject: [PATCH] Fix testcase test_assert_all_requests_are_fired failure
|
|
|
|
Pytest 5.0.0 changed ExceptionInfo object's str() to returns the same as repr().
|
|
(See, item #5412 of https://docs.pytest.org/en/latest/changelog.html#pytest-5-0-0-2019-06-28)
|
|
This patch fixes the test failure by comparing expectation with str() result of
|
|
ExceptionInfo's value member instaed of object itself.
|
|
|
|
Signed-off-by: Brandon Hong <brandon.hong@intel.com>
|
|
---
|
|
test_responses.py | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/test_responses.py b/test_responses.py
|
|
index 4740dfb..c2a4f01 100644
|
|
--- a/test_responses.py
|
|
+++ b/test_responses.py
|
|
@@ -701,7 +701,7 @@ def run():
|
|
with responses.RequestsMock(assert_all_requests_are_fired=True) as m:
|
|
m.add(responses.GET, "http://example.com", body=b"test")
|
|
assert "http://example.com" in str(excinfo.value)
|
|
- assert responses.GET in str(excinfo)
|
|
+ assert responses.GET in str(excinfo.value)
|
|
|
|
# check that assert_all_requests_are_fired default to True
|
|
with pytest.raises(AssertionError):
|