_eq should assign placeholders.
()
| 138 | |
| 139 | |
| 140 | def test_eq_placeholder(): |
| 141 | """_eq should assign placeholders.""" |
| 142 | a = TCommand() |
| 143 | a.foo = 42 |
| 144 | a.bar = tutils.Placeholder() |
| 145 | b = TCommand() |
| 146 | b.foo = tutils.Placeholder() |
| 147 | b.bar = 43 |
| 148 | assert tutils._eq(a, b) |
| 149 | assert a.foo == b.foo() == 42 |
| 150 | assert a.bar() == b.bar == 43 |
| 151 | |
| 152 | b.foo._obj = 44 |
| 153 | assert not tutils._eq(a, b) |
| 154 | |
| 155 | |
| 156 | @pytest.mark.parametrize("swap", [False, True]) |