mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
119 lines
1.8 KiB
Python
119 lines
1.8 KiB
Python
# python > 2.7
|
|
import pytest
|
|
from pytest import fixture
|
|
|
|
|
|
@pytest.fixture(scope='module')
|
|
def my_fixture() -> str:
|
|
pass
|
|
|
|
|
|
@fixture
|
|
def my_simple_fixture():
|
|
return 1
|
|
|
|
|
|
@fixture
|
|
def my_yield_fixture():
|
|
yield 1
|
|
|
|
|
|
@fixture
|
|
class MyClassFixture():
|
|
pass
|
|
|
|
# -----------------
|
|
# goto/infer
|
|
# -----------------
|
|
|
|
#! 18 ['def my_conftest_fixture']
|
|
def test_x(my_conftest_fixture, my_fixture, my_not_existing_fixture, my_yield_fixture):
|
|
#? str()
|
|
my_fixture
|
|
#? int()
|
|
my_yield_fixture
|
|
#?
|
|
my_not_existing_fixture
|
|
#? float()
|
|
return my_conftest_fixture
|
|
|
|
#? 18 float()
|
|
def test_x(my_conftest_fixture, my_fixture):
|
|
pass
|
|
|
|
|
|
#! 18 ['param MyClassFixture']
|
|
def test_x(MyClassFixture):
|
|
#?
|
|
MyClassFixture
|
|
|
|
#? 15
|
|
def lala(my_fixture):
|
|
pass
|
|
|
|
@pytest.fixture
|
|
#? 15 str()
|
|
def lala(my_fixture):
|
|
pass
|
|
|
|
#! 15 ['param my_fixture']
|
|
def lala(my_fixture):
|
|
pass
|
|
|
|
@pytest.fixture
|
|
#! 15 ['def my_fixture']
|
|
def lala(my_fixture):
|
|
pass
|
|
|
|
# -----------------
|
|
# completion
|
|
# -----------------
|
|
|
|
#? 34 ['my_fixture']
|
|
def test_x(my_simple_fixture, my_fixture):
|
|
return
|
|
#? 34 ['my_fixture']
|
|
def test_x(my_simple_fixture, my_fixture):
|
|
return
|
|
#? ['my_fixture']
|
|
def test_x(my_simple_fixture, my_f
|
|
return
|
|
#? 18 ['my_simple_fixture']
|
|
def test_x(my_simple_fixture):
|
|
return
|
|
#? ['my_simple_fixture']
|
|
def test_x(my_simp
|
|
return
|
|
#? ['my_conftest_fixture']
|
|
def test_x(my_con
|
|
return
|
|
#? 18 ['my_conftest_fixture']
|
|
def test_x(my_conftest_fixture):
|
|
return
|
|
|
|
#? []
|
|
def lala(my_con
|
|
return
|
|
|
|
@pytest.fixture
|
|
#? ['my_conftest_fixture']
|
|
def lala(my_con
|
|
return
|
|
|
|
@pytest.fixture
|
|
#? 15 ['my_conftest_fixture']
|
|
def lala(my_con):
|
|
return
|
|
|
|
@pytest.fixture
|
|
@some_decorator
|
|
#? ['my_conftest_fixture']
|
|
def lala(my_con
|
|
return
|
|
|
|
@pytest.fixture
|
|
@some_decorator
|
|
#? 15 ['my_conftest_fixture']
|
|
def lala(my_con):
|
|
return
|