(pytester: Pytester)
| 259 | |
| 260 | |
| 261 | def test_setup_failure_is_shown(pytester: Pytester) -> None: |
| 262 | pytester.makepyfile( |
| 263 | """ |
| 264 | import unittest |
| 265 | import pytest |
| 266 | class TC(unittest.TestCase): |
| 267 | def setUp(self): |
| 268 | assert 0, "down1" |
| 269 | def test_method(self): |
| 270 | print("never42") |
| 271 | xyz |
| 272 | """ |
| 273 | ) |
| 274 | result = pytester.runpytest("-s") |
| 275 | assert result.ret == 1 |
| 276 | result.stdout.fnmatch_lines(["*setUp*", "*assert 0*down1*", "*1 failed*"]) |
| 277 | result.stdout.no_fnmatch_line("*never42*") |
| 278 | |
| 279 | |
| 280 | def test_setup_setUpClass(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected