diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 19b977224..e09ffaddb 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -553,7 +553,7 @@ class FixtureRequest(FuncargnamesCompatAttr): if node is None and scope == "class": # fallback to function item itself node = self._pyfuncitem - assert node + assert node, 'Could not obtain a node for scope "{}" for function {!r}'.format(scope, self._pyfuncitem) return node def __repr__(self):