mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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:
committed by
intellij-monorepo-bot
parent
798bbf238c
commit
50fa4b90d2
@@ -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
|
||||
+10
@@ -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
|
||||
Reference in New Issue
Block a user