Browse Source

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>
pull/2803/head
Christian Decker 5 years ago
parent
commit
fd1e8a5999
  1. 2
      tests/fixtures.py

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

Loading…
Cancel
Save