Some checks failed
Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
Detach Plugins / check (GitHub.vim) (push) Has been cancelled
Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
Detach Plugins / check (git.vim) (push) Has been cancelled
Detach Plugins / check (iedit.vim) (push) Has been cancelled
Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
Detach Plugins / check (vim-chat) (push) Has been cancelled
Detach Plugins / check (vim-cheat) (push) Has been cancelled
Detach Plugins / check (vim-todo) (push) Has been cancelled
Detach Plugins / check (xmake.vim) (push) Has been cancelled
test / Linux (nvim, nightly) (push) Has been cancelled
test / Linux (nvim, v0.3.8) (push) Has been cancelled
test / Linux (nvim, v0.4.0) (push) Has been cancelled
test / Linux (nvim, v0.4.2) (push) Has been cancelled
test / Linux (nvim, v0.4.3) (push) Has been cancelled
test / Linux (nvim, v0.4.4) (push) Has been cancelled
test / Linux (nvim, v0.5.0) (push) Has been cancelled
test / Linux (nvim, v0.5.1) (push) Has been cancelled
test / Linux (nvim, v0.6.0) (push) Has been cancelled
test / Linux (nvim, v0.6.1) (push) Has been cancelled
test / Linux (nvim, v0.7.0) (push) Has been cancelled
test / Linux (nvim, v0.7.2) (push) Has been cancelled
test / Linux (nvim, v0.8.0) (push) Has been cancelled
test / Linux (nvim, v0.8.1) (push) Has been cancelled
test / Linux (nvim, v0.8.2) (push) Has been cancelled
test / Linux (nvim, v0.8.3) (push) Has been cancelled
test / Linux (nvim, v0.9.0) (push) Has been cancelled
test / Linux (nvim, v0.9.1) (push) Has been cancelled
test / Linux (true, vim, v7.4.052) (push) Has been cancelled
test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
test / Linux (true, vim, v7.4.629) (push) Has been cancelled
test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
test / Linux (vim, nightly) (push) Has been cancelled
test / Linux (vim, v8.0.0184) (push) Has been cancelled
test / Linux (vim, v8.0.1453) (push) Has been cancelled
test / Linux (vim, v8.1.2269) (push) Has been cancelled
test / Linux (vim, v8.2.2434) (push) Has been cancelled
test / Linux (vim, v8.2.3995) (push) Has been cancelled
test / Windows (nvim, nightly) (push) Has been cancelled
test / Windows (nvim, v0.3.8) (push) Has been cancelled
test / Windows (nvim, v0.4.2) (push) Has been cancelled
test / Windows (nvim, v0.4.3) (push) Has been cancelled
test / Windows (nvim, v0.4.4) (push) Has been cancelled
test / Windows (nvim, v0.5.0) (push) Has been cancelled
test / Windows (nvim, v0.5.1) (push) Has been cancelled
test / Windows (nvim, v0.6.0) (push) Has been cancelled
test / Windows (nvim, v0.6.1) (push) Has been cancelled
test / Windows (nvim, v0.7.0) (push) Has been cancelled
test / Windows (nvim, v0.7.2) (push) Has been cancelled
test / Windows (nvim, v0.8.0) (push) Has been cancelled
test / Windows (nvim, v0.8.1) (push) Has been cancelled
test / Windows (nvim, v0.8.2) (push) Has been cancelled
test / Windows (nvim, v0.8.3) (push) Has been cancelled
test / Windows (nvim, v0.9.0) (push) Has been cancelled
test / Windows (nvim, v0.9.1) (push) Has been cancelled
test / Windows (vim, nightly) (push) Has been cancelled
test / Windows (vim, v7.4.1185) (push) Has been cancelled
test / Windows (vim, v7.4.1689) (push) Has been cancelled
test / Windows (vim, v8.0.0027) (push) Has been cancelled
test / Windows (vim, v8.0.1453) (push) Has been cancelled
test / Windows (vim, v8.1.2269) (push) Has been cancelled
test / Windows (vim, v8.2.2434) (push) Has been cancelled
test / Windows (vim, v8.2.3995) (push) Has been cancelled
docker / docker (push) Has been cancelled
mirror / check (coding) (push) Has been cancelled
mirror / check (gitee) (push) Has been cancelled
mirror / check (gitlab) (push) Has been cancelled
186 lines
2.9 KiB
Python
186 lines
2.9 KiB
Python
from typing import Generator
|
|
|
|
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
|
|
|
|
# overriding types of a fixture should be possible
|
|
def test_x(my_yield_fixture: str):
|
|
#? str()
|
|
my_yield_fixture
|
|
|
|
# -----------------
|
|
# 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
|
|
|
|
# -----------------
|
|
# pytest owned fixtures
|
|
# -----------------
|
|
|
|
#? ['monkeypatch']
|
|
def test_p(monkeyp
|
|
|
|
|
|
#! 15 ['def monkeypatch']
|
|
def test_p(monkeypatch):
|
|
#? ['setattr']
|
|
monkeypatch.setatt
|
|
|
|
#? ['capsysbinary']
|
|
def test_p(capsysbin
|
|
|
|
#? ['tmpdir', 'tmpdir_factory']
|
|
def test_p(tmpdi
|
|
|
|
|
|
def close_parens():
|
|
pass
|
|
# -----------------
|
|
# inheritance
|
|
# -----------------
|
|
|
|
@fixture
|
|
#? 40 ['inheritance_fixture']
|
|
def inheritance_fixture(inheritance_fixture):
|
|
#? str()
|
|
inheritance_fixture
|
|
#? ['upper']
|
|
inheritance_fixture.upper
|
|
return 1
|
|
|
|
|
|
#! 48 ['def inheritance_fixture']
|
|
def test_inheritance_fixture(inheritance_fixture, caplog):
|
|
#? int()
|
|
inheritance_fixture
|
|
|
|
#? ['set_level']
|
|
caplog.set_le
|
|
|
|
|
|
@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
|