This used to report the wrong location when run with coverage (#5754).
(pytester: Pytester)
| 1660 | |
| 1661 | |
| 1662 | def test_assertion_location_with_coverage(pytester: Pytester) -> None: |
| 1663 | """This used to report the wrong location when run with coverage (#5754).""" |
| 1664 | p = pytester.makepyfile( |
| 1665 | """ |
| 1666 | def test(): |
| 1667 | assert False, 1 |
| 1668 | assert False, 2 |
| 1669 | """ |
| 1670 | ) |
| 1671 | result = pytester.runpytest(str(p)) |
| 1672 | result.stdout.fnmatch_lines( |
| 1673 | [ |
| 1674 | "> assert False, 1", |
| 1675 | "E AssertionError: 1", |
| 1676 | "E assert False", |
| 1677 | "*= 1 failed in*", |
| 1678 | ] |
| 1679 | ) |
nothing calls this directly
no test coverage detected