---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT022 [*] No teardown in fixture `error`, use `return` instead of `yield`
  --> PT022.py:17:5
   |
15 | def error():
16 |     resource = acquire_resource()
17 |     yield resource
   |     ^^^^^^^^^^^^^^
   |
help: Replace `yield` with `return`
   |
16 |     resource = acquire_resource()
   -     yield resource
17 +     return resource
18 |
   |

PT022 [*] No teardown in fixture `error`, use `return` instead of `yield`
  --> PT022.py:37:5
   |
35 | def error() -> typing.Generator[typing.Any, None, None]:
36 |     resource = acquire_resource()
37 |     yield resource
   |     ^^^^^^^^^^^^^^
   |
help: Replace `yield` with `return`
   |
34 | @pytest.fixture()
   - def error() -> typing.Generator[typing.Any, None, None]:
35 + def error() -> typing.Any:
36 |     resource = acquire_resource()
   -     yield resource
37 +     return resource
38 |
   |

PT022 [*] No teardown in fixture `error`, use `return` instead of `yield`
  --> PT022.py:43:5
   |
41 | def error() -> Generator[Resource, None, None]:
42 |     resource = acquire_resource()
43 |     yield resource
   |     ^^^^^^^^^^^^^^
   |
help: Replace `yield` with `return`
   |
40 | @pytest.fixture()
   - def error() -> Generator[Resource, None, None]:
41 + def error() -> Resource:
42 |     resource = acquire_resource()
   -     yield resource
43 +     return resource
   |
