Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
@ operator lets the assertion rewrite hang up #1290
It seems like the @ operator isn't recognized by something int the assertion_rewrite procedure.
I did some fake test to single out the problem in fake_matrix.py:
class FakeMatrix: def __init__(self, num): self.num = num def __matmul__(self, other): return self.num * other.num
and the test file:
from fake_matrix import FakeMatrix def test_multmat_operator(): assert FakeMatrix(2) @ FakeMatrix(3) == 6
My system is debian linux stretch, and as you can see I'm using Python 3.5.0+, pytest-2.8.5 on a virtualenv
referenced this issue
Feb 5, 2016
Not strictly involved with this bug, but if you over can't sleep, you can look at pytest's generated rewritten ast, converted back to python with these instructions (now updated for Python 3).
For a failing version of your test @Shinkenjoe it generates this: