дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-28 13:32:29 +02:00
A fixture parameter of a test or fixture now resolves to the fixture that pytest would inject: the nearest definition in the same class or module, then the conftest.py chain up to the root, pytest_plugins modules, pytest11 entry points and the _pytest builtins. Go to Declaration opens it, and completion in a test's parameter list offers the fixtures in scope with their source file. Named fixtures (name=...) and usefixtures("...") strings are covered; the fixture layers are cached by file mtime.
Closes #6490
Co-authored-by: wildcatDownstairs <[email protected]>
16 рядки
262 B
Python
16 рядки
262 B
Python
import pytest
|
|
|
|
from tasks import Priority, TaskList
|
|
|
|
|
|
@pytest.fixture
|
|
def tasks():
|
|
return TaskList()
|
|
|
|
|
|
@pytest.fixture(name="sample")
|
|
def sample_tasks(tasks):
|
|
tasks.add("write docs", Priority.HIGH)
|
|
tasks.add("tidy up", Priority.LOW)
|
|
return tasks
|