Skip to content

Commit a3fbf24

Browse files
committed
unittest: hide access to _request
Let the parent class (Function) do this. Tiny bit better abstraction. There seems to be no reason for the `hasattr` bit.
1 parent bf451d4 commit a3fbf24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/unittest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ def setup(self) -> None:
200200
assert self.parent is not None
201201
self._testcase = self.parent.obj(self.name) # type: ignore[attr-defined]
202202
self._obj = getattr(self._testcase, self.name)
203-
if hasattr(self, "_request"):
204-
self._request._fillfixtures()
203+
super().setup()
205204

206205
def teardown(self) -> None:
206+
super().teardown()
207207
if self._explicit_tearDown is not None:
208208
self._explicit_tearDown()
209209
self._explicit_tearDown = None

0 commit comments

Comments
 (0)