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 <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2019-08-28 23:44:44 +02:00
parent 245dff26e0
commit fd1e8a5999

View File

@ -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: