(self, pytester: Pytester, option)
| 1600 | result.stdout.fnmatch_lines(["*- Captured stdout call -*", output_to_capture]) |
| 1601 | |
| 1602 | def test_tb_crashline(self, pytester: Pytester, option) -> None: |
| 1603 | p = pytester.makepyfile( |
| 1604 | """ |
| 1605 | import pytest |
| 1606 | def g(): |
| 1607 | raise IndexError |
| 1608 | def test_func1(): |
| 1609 | print(6*7) |
| 1610 | g() # --calling-- |
| 1611 | def test_func2(): |
| 1612 | assert 0, "hello" |
| 1613 | """ |
| 1614 | ) |
| 1615 | result = pytester.runpytest("--tb=line") |
| 1616 | bn = p.name |
| 1617 | result.stdout.fnmatch_lines( |
| 1618 | [f"*{bn}:3: IndexError*", f"*{bn}:8: AssertionError: hello*"] |
| 1619 | ) |
| 1620 | s = result.stdout.str() |
| 1621 | assert "def test_func2" not in s |
| 1622 | |
| 1623 | def test_tb_crashline_pytrace_false(self, pytester: Pytester, option) -> None: |
| 1624 | p = pytester.makepyfile( |
nothing calls this directly
no test coverage detected