From 6d3fe0b826c2aacf1eec573ed0fd50eb8774ee77 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 12 Nov 2017 11:28:57 -0200 Subject: [PATCH] Explicitly clear finalizers list in finalize to ensure cleanup --- _pytest/fixtures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 74efd309d..ceae79cb4 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -765,6 +765,7 @@ class FixtureDef: # keep instances alive if hasattr(self, "cached_result"): del self.cached_result + self._finalizer = [] def execute(self, request): # get required arguments and register our own finish()