| 1 |
from typing import Generator |
| 2 |
|
| 3 |
import pytest |
| 4 |
from pytest import fixture |
| 5 |
|
| 6 |
|
| 7 |
@pytest.fixture(scope='module') |
| 8 |
def my_fixture() -> str: |
| 9 |
pass |
| 10 |
|
| 11 |
|
| 12 |
@fixture |
| 13 |
def my_simple_fixture(): |
| 14 |
return 1 |
| 15 |
|
| 16 |
|
| 17 |
@fixture |
| 18 |
def my_yield_fixture(): |
| 19 |
yield 1 |
| 20 |
|
| 21 |
|
| 22 |
@fixture |
| 23 |
class MyClassFixture(): |
| 24 |
pass |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
def test_x(my_conftest_fixture, my_fixture, my_not_existing_fixture, my_yield_fixture): |
| 32 |
|
| 33 |
my_fixture |
| 34 |
|
| 35 |
my_yield_fixture |
| 36 |
|
| 37 |
my_not_existing_fixture |
| 38 |
|
| 39 |
return my_conftest_fixture |
| 40 |
|
| 41 |
|
| 42 |
def test_x(my_conftest_fixture, my_fixture): |
| 43 |
pass |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
def test_x(MyClassFixture): |
| 48 |
|
| 49 |
MyClassFixture |
| 50 |
|
| 51 |
|
| 52 |
def lala(my_fixture): |
| 53 |
pass |
| 54 |
|
| 55 |
@pytest.fixture |
| 56 |
|
| 57 |
def lala(my_fixture): |
| 58 |
pass |
| 59 |
|
| 60 |
|
| 61 |
def lala(my_fixture): |
| 62 |
pass |
| 63 |
|
| 64 |
@pytest.fixture |
| 65 |
|
| 66 |
def lala(my_fixture): |
| 67 |
pass |
| 68 |
|
| 69 |
|
| 70 |
def test_x(my_yield_fixture: str): |
| 71 |
|
| 72 |
my_yield_fixture |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
def test_x(my_simple_fixture, my_fixture): |
| 80 |
return |
| 81 |
|
| 82 |
def test_x(my_simple_fixture, my_fixture): |
| 83 |
return |
| 84 |
|
| 85 |
def test_x(my_simple_fixture, my_f |
| 86 |
return |
| 87 |
|
| 88 |
def test_x(my_simple_fixture): |
| 89 |
return |
| 90 |
|
| 91 |
def test_x(my_simp |
| 92 |
return |
| 93 |
|
| 94 |
def test_x(my_con |
| 95 |
return |
| 96 |
|
| 97 |
def test_x(my_conftest_fixture): |
| 98 |
return |
| 99 |
|
| 100 |
def test_x(my_modu |
| 101 |
return |
| 102 |
|
| 103 |
|
| 104 |
def lala(my_con |
| 105 |
return |
| 106 |
|
| 107 |
@pytest.fixture |
| 108 |
|
| 109 |
def lala(my_con |
| 110 |
return |
| 111 |
|
| 112 |
@pytest.fixture |
| 113 |
|
| 114 |
def lala(my_con): |
| 115 |
return |
| 116 |
|
| 117 |
@pytest.fixture |
| 118 |
@some_decorator |
| 119 |
|
| 120 |
def lala(my_con |
| 121 |
return |
| 122 |
|
| 123 |
@pytest.fixture |
| 124 |
@some_decorator |
| 125 |
|
| 126 |
def lala(my_con): |
| 127 |
return |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
def test_p(monkeyp |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
def test_p(monkeypatch): |
| 139 |
|
| 140 |
monkeypatch.setatt |
| 141 |
|
| 142 |
|
| 143 |
def test_p(capsysbin |
| 144 |
|
| 145 |
|
| 146 |
def close_parens(): |
| 147 |
pass |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
@fixture |
| 153 |
|
| 154 |
def inheritance_fixture(inheritance_fixture): |
| 155 |
|
| 156 |
inheritance_fixture |
| 157 |
|
| 158 |
inheritance_fixture.upper |
| 159 |
return 1 |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
def test_inheritance_fixture(inheritance_fixture, caplog): |
| 164 |
|
| 165 |
inheritance_fixture |
| 166 |
|
| 167 |
|
| 168 |
caplog.set_le |
| 169 |
|
| 170 |
|
| 171 |
@pytest.fixture |
| 172 |
def caplog(caplog): |
| 173 |
yield caplog |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
@pytest.fixture |
| 180 |
def with_annot() -> Generator[float, None, None]: |
| 181 |
pass |
| 182 |
|
| 183 |
def test_with_annot(inheritance_fixture, with_annot): |
| 184 |
|
| 185 |
with_annot |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
def test_z(admin |
| 193 |
|
| 194 |
|
| 195 |
def test_p(admin_client): |
| 196 |
|
| 197 |
admin_client.log |
| 198 |
|
| 199 |
@pytest.fixture |
| 200 |
@some_decorator |
| 201 |
|
| 202 |
def bla(admin_u |
| 203 |
return |
| 204 |
|
| 205 |
@pytest.fixture |
| 206 |
@some_decorator |
| 207 |
|
| 208 |
def bla(admin_user): |
| 209 |
pass |
| 210 |
|