Closed reergymerej closed 1 year ago
Nm, found it.
pytest.register_assert_rewrite('tests.utils') # <<<<<<<<<
from tests.utils import over_here
def test_diff():
over_here()
# tests/utils.py
def over_here():
assert {"1": 1} == {"2": 1}
E LHS vs RHS shown below
E
E {'1': 1}
E {'1': 2}
Assertions raised from outside the test file are not diffed. Here's an example.
Is this a failure in pytest_assertrepr_compare maybe?
Baseline - beautiful.
Assert in non-test function, still beautiful.
Assert in another file, dang.