From fd1e8a5999dc6a42f72ccf9d9763a0e567ea61a7 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 28 Aug 2019 23:44:44 +0200 Subject: [PATCH] pytest: Fix directory deletion on passed tests We were checking the test request against the searched for string. This fixes it by actually looking at the outcome instead and should clean up correctly if tests do not fail. Signed-off-by: Christian Decker --- tests/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 7e41cf27f..5708d8699 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -57,7 +57,7 @@ def directory(request, test_base_dir, test_name): # determine whether we succeeded or failed. Outcome can be None if the # failure occurs during the setup phase, hence the use to getattr instead # of accessing it directly. - outcome = getattr(request.node, 'rep_call', None) + outcome = getattr(request.node, 'rep_call', None).outcome failed = not outcome or request.node.has_errors or outcome != 'passed' if not failed: