Skip to content

Commit a6f2d2d

Browse files
committed
Rename FixtureDef.finalizer to FixtureDef.finalizers
1 parent 6d3fe0b commit a6f2d2d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

_pytest/fixtures.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
from __future__ import absolute_import, division, print_function
22

3+
import functools
34
import inspect
45
import sys
56
import warnings
7+
from collections import OrderedDict
68

7-
import functools
9+
import attr
810
import py
911
from py._code.code import FormattedExcinfo
1012

11-
import attr
1213
import _pytest
1314
from _pytest import nodes
1415
from _pytest._code.code import TerminalRepr
@@ -23,9 +24,6 @@
2324
from _pytest.outcomes import fail, TEST_OUTCOME
2425

2526

26-
from collections import OrderedDict
27-
28-
2927
def pytest_sessionstart(session):
3028
import _pytest.python
3129

@@ -737,17 +735,17 @@ def __init__(self, fixturemanager, baseid, argname, func, scope, params,
737735
self.argnames = getfuncargnames(func, is_method=unittest)
738736
self.unittest = unittest
739737
self.ids = ids
740-
self._finalizer = []
738+
self._finalizers = []
741739

742740
def addfinalizer(self, finalizer):
743-
self._finalizer.append(finalizer)
741+
self._finalizers.append(finalizer)
744742

745743
def finish(self, request):
746744
exceptions = []
747745
try:
748-
while self._finalizer:
746+
while self._finalizers:
749747
try:
750-
func = self._finalizer.pop()
748+
func = self._finalizers.pop()
751749
func()
752750
except: # noqa
753751
exceptions.append(sys.exc_info())
@@ -765,7 +763,7 @@ def finish(self, request):
765763
# keep instances alive
766764
if hasattr(self, "cached_result"):
767765
del self.cached_result
768-
self._finalizer = []
766+
self._finalizers = []
769767

770768
def execute(self, request):
771769
# get required arguments and register our own finish()

0 commit comments

Comments
 (0)