Execute the teardown of a fixture function by advancing the iterator after the yield and ensure the iteration ends (if not it means there is more than one yield in the function).
(fixturefunc, it)
| 1007 | |
| 1008 | |
| 1009 | def _teardown_yield_fixture(fixturefunc, it) -> None: |
| 1010 | """Execute the teardown of a fixture function by advancing the iterator |
| 1011 | after the yield and ensure the iteration ends (if not it means there is |
| 1012 | more than one yield in the function).""" |
| 1013 | try: |
| 1014 | next(it) |
| 1015 | except StopIteration: |
| 1016 | pass |
| 1017 | else: |
| 1018 | fs, lineno = getfslineno(fixturefunc) |
| 1019 | fail( |
| 1020 | f"fixture function has more than one 'yield':\n\n" |
| 1021 | f"{Source(fixturefunc).indent()}\n" |
| 1022 | f"{fs}:{lineno + 1}", |
| 1023 | pytrace=False, |
| 1024 | ) |
| 1025 | |
| 1026 | |
| 1027 | def _eval_scope_callable( |
nothing calls this directly
no test coverage detected