(self, pytester: Pytester, flag_on, hook_on)
| 1509 | ) |
| 1510 | |
| 1511 | def test_hook_call(self, pytester: Pytester, flag_on, hook_on) -> None: |
| 1512 | pytester.makepyfile( |
| 1513 | """\ |
| 1514 | def test_simple(): |
| 1515 | a=1 |
| 1516 | b=2 |
| 1517 | c=3 |
| 1518 | d=0 |
| 1519 | |
| 1520 | assert a+b == c+d |
| 1521 | |
| 1522 | # cover failing assertions with a message |
| 1523 | def test_fails(): |
| 1524 | assert False, "assert with message" |
| 1525 | """ |
| 1526 | ) |
| 1527 | result = pytester.runpytest() |
| 1528 | result.stdout.fnmatch_lines( |
| 1529 | "*Assertion Passed: a+b == c+d (1 + 2) == (3 + 0) at line 7*" |
| 1530 | ) |
| 1531 | |
| 1532 | def test_hook_call_with_parens(self, pytester: Pytester, flag_on, hook_on) -> None: |
| 1533 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected