forked from VimPlug/jedi
Get some pytest fixtures working with some side effects
This commit is contained in:
17
test/completion/conftest.py
Normal file
17
test/completion/conftest.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Exists only for completion/pytest.py
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def my_other_conftest_fixture():
|
||||
return 1.0
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def my_conftest_fixture(my_other_conftest_fixture):
|
||||
return my_other_conftest_fixture
|
||||
|
||||
|
||||
def my_not_existing_fixture():
|
||||
return 3 # Just a normal function
|
||||
45
test/completion/pytest.py
Normal file
45
test/completion/pytest.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# python > 2
|
||||
import pytest
|
||||
from pytest import fixture
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def my_fixture() -> str:
|
||||
pass
|
||||
|
||||
|
||||
@fixture
|
||||
def my_simple_fixture():
|
||||
return 1
|
||||
|
||||
|
||||
# -----------------
|
||||
# goto/infer
|
||||
# -----------------
|
||||
|
||||
#! 18 'def my_conftest_fixture'
|
||||
def test_x(my_conftest_fixture, my_fixture, my_not_existing_fixture):
|
||||
#? str()
|
||||
my_fixture
|
||||
#?
|
||||
my_not_existing_fixture
|
||||
#? float()
|
||||
return my_conftest_fixture
|
||||
|
||||
#? 18 float()
|
||||
def test_x(my_conftest_fixture, my_fixture):
|
||||
pass
|
||||
|
||||
# -----------------
|
||||
# completion
|
||||
# -----------------
|
||||
|
||||
#? 34 ['my_fixture']
|
||||
def test_x(my_simple_fixture, my_fixture):
|
||||
return
|
||||
#? 18 ['my_simple_fixture']
|
||||
def test_x(my_simple_fixture):
|
||||
return
|
||||
#? 18 ['my_conftest_fixture']
|
||||
def test_x(my_conftest_fixture):
|
||||
return
|
||||
Reference in New Issue
Block a user