warns when usefixtures is empty

This commit is contained in:
Jiajun Xu 2024-06-07 23:56:55 -04:00
parent cbf6bd9dd2
commit b95e85ab93
1 changed files with 2 additions and 0 deletions

View File

@ -1525,6 +1525,8 @@ class FixtureManager:
def _getusefixturesnames(self, node: nodes.Item) -> Iterator[str]:
"""Return the names of usefixtures fixtures applicable to node."""
for mark in node.iter_markers(name="usefixtures"):
if not mark.args:
warnings.warn(f"Warning: empty usefixtures in {node.name}.")
yield from mark.args
def getfixtureclosure(