From 8aa29a2ba252e3ca2bf97cd1755ec1131822a42d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 9 Nov 2015 07:38:34 +0100 Subject: [PATCH] bdd: Fix assert in "The requests should be" step. When we call get_requests() inside the assertion, it won't act the same when reinterpreting it. --- tests/integration/features/conftest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 5897dd784..f6d8e5360 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -92,9 +92,10 @@ def path_should_be_loaded(httpbin, path): @bdd.then(bdd.parsers.parse("The requests should be:\n{pages}")) def list_of_loaded_pages(httpbin, pages): - requests = [httpbin.Request('GET', '/' + path.strip()) - for path in pages.split('\n')] - assert httpbin.get_requests() == requests + expected_requests = [httpbin.Request('GET', '/' + path.strip()) + for path in pages.split('\n')] + actual_requests = httpbin.get_requests() + assert actual_requests == expected_requests @bdd.then(bdd.parsers.re(r'the (?Perror|message|warning) '