Verify that setups are shown and tests are executed.
(pytester: Pytester)
| 257 | |
| 258 | |
| 259 | def test_show_fixtures_and_execute_test(pytester: Pytester) -> None: |
| 260 | """Verify that setups are shown and tests are executed.""" |
| 261 | p = pytester.makepyfile( |
| 262 | """ |
| 263 | import pytest |
| 264 | @pytest.fixture |
| 265 | def arg(): |
| 266 | assert True |
| 267 | def test_arg(arg): |
| 268 | assert False |
| 269 | """ |
| 270 | ) |
| 271 | |
| 272 | result = pytester.runpytest("--setup-show", p) |
| 273 | assert result.ret == 1 |
| 274 | |
| 275 | result.stdout.fnmatch_lines( |
| 276 | ["*SETUP F arg*", "*test_arg (fixtures used: arg)F*", "*TEARDOWN F arg*"] |
| 277 | ) |
| 278 | |
| 279 | |
| 280 | def test_setup_show_with_KeyboardInterrupt_in_test(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected