From 70f1e3b4b0cdcf428fdcf44b6bc62ad76e2a03b2 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 30 Nov 2017 07:47:00 -0200 Subject: [PATCH] Improve getscopeitem assertion message Fix #2979 --- _pytest/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):