[python] PY-63483, PY-83912, PY-70815 False positive warning Fixture '...' is not requested by test functions for attributes

Merge-request: IJ-MR-181099
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 7299d76d38ae5a823a3b0cae7ba5e2a0cc693d13)

IJ-MR-181099

GitOrigin-RevId: 82be14096cccf01de85fcf7f7abb4af2fd838193
This commit is contained in:
chbndrhnns
2025-11-05 16:53:26 +00:00
committed by intellij-monorepo-bot
parent 798bbf238c
commit 50fa4b90d2
6 changed files with 98 additions and 0 deletions
@@ -0,0 +1,22 @@
import pytest
from contextlib import asynccontextmanager
class C:
async def bla(self):
...
@asynccontextmanager
async def create():
yield C()
@pytest.fixture
def client():
pass
async def test_():
async with create() as client:
assert await client.bla() == 1 # no inspection warning expected
@@ -0,0 +1,14 @@
import pytest
class Unrelated:
...
@pytest.fixture
def fixture():
return True
def test_():
assert Unrelated().fixture # no inspection warning expected
@@ -0,0 +1,10 @@
import pytest
class TestBla:
@pytest.fixture
def my_f(self):
...
def test_(self):
self.my_f() # no inspection warning expected
@@ -0,0 +1,22 @@
import pytest
from contextlib import contextmanager
class C:
def bla(self):
...
@contextmanager
def create():
yield C()
@pytest.fixture
def client():
pass
def test_():
with create() as client:
assert client.bla() == 1 # no inspection warning expected