-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectly
Description
Someone in my pytest training accidentally did:
import pytest
@pytest.mark.usefixtures()
def test_fixt():
pass
but forgot to pass a fixture name. Because we do:
pytest/src/_pytest/fixtures.py
Lines 1536 to 1539 in 0070151
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"): | |
yield from mark.args |
That results in the mark being silently ignored. IMHO, this should result in a warning or even error instead.
I think this would be a great beginner issue for someone that never contributed to pytest before. Maybe someone at the upcoming sprint wants to take a look?
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectly