mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix fixture annotations for pytest
This means mostly these: @fixture def foo() -> Generator[int, None, None]: ...
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from typing import Generator
|
||||
|
||||
import pytest
|
||||
from pytest import fixture
|
||||
|
||||
@@ -169,3 +171,15 @@ def test_inheritance_fixture(inheritance_fixture, caplog):
|
||||
@pytest.fixture
|
||||
def caplog(caplog):
|
||||
yield caplog
|
||||
|
||||
# -----------------
|
||||
# Generator with annotation
|
||||
# -----------------
|
||||
|
||||
@pytest.fixture
|
||||
def with_annot() -> Generator[float, None, None]:
|
||||
pass
|
||||
|
||||
def test_with_annot(inheritance_fixture, with_annot):
|
||||
#? float()
|
||||
with_annot
|
||||
|
||||
Reference in New Issue
Block a user