Skip to content

Commit 9a61d8b

Browse files
committed
Rename test Op to not confuse pytest
1 parent 7bb18f3 commit 9a61d8b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/tensor/test_blockwise.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ def test_vectorize_blockwise():
3838
assert new_vect_node.inputs[0] is tns4
3939

4040

41-
class TestOp(Op):
41+
class MyTestOp(Op):
4242
def make_node(self, *inputs):
4343
return Apply(self, inputs, [i.type() for i in inputs])
4444

4545
def perform(self, *args, **kwargs):
4646
raise NotImplementedError("Test Op should not be present in final graph")
4747

4848

49-
test_op = TestOp()
49+
test_op = MyTestOp()
5050

5151

5252
def test_vectorize_node_default_signature():
@@ -56,7 +56,7 @@ def test_vectorize_node_default_signature():
5656

5757
vect_node = vectorize_node(node, mat, mat)
5858
assert isinstance(vect_node.op, Blockwise) and isinstance(
59-
vect_node.op.core_op, TestOp
59+
vect_node.op.core_op, MyTestOp
6060
)
6161
assert vect_node.op.signature == ("(i00),(i10,i11)->(o00),(o10,o11)")
6262

@@ -88,7 +88,7 @@ def test_blockwise_shape():
8888

8989
shape_fn = pytensor.function([inp], out.shape)
9090
assert not any(
91-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
91+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
9292
for n in shape_fn.maker.fgraph.apply_nodes
9393
)
9494
assert tuple(shape_fn(inp_test)) == (5, 3, 4)
@@ -100,13 +100,13 @@ def test_blockwise_shape():
100100

101101
shape_fn = pytensor.function([inp], out.shape)
102102
assert any(
103-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
103+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
104104
for n in shape_fn.maker.fgraph.apply_nodes
105105
)
106106

107107
shape_fn = pytensor.function([inp], out.shape[:-1])
108108
assert not any(
109-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
109+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
110110
for n in shape_fn.maker.fgraph.apply_nodes
111111
)
112112
assert tuple(shape_fn(inp_test)) == (5, 4)
@@ -124,20 +124,20 @@ def test_blockwise_shape():
124124

125125
shape_fn = pytensor.function([inp1, inp2], [out.shape for out in outs])
126126
assert any(
127-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
127+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
128128
for n in shape_fn.maker.fgraph.apply_nodes
129129
)
130130

131131
shape_fn = pytensor.function([inp1, inp2], outs[0].shape)
132132
assert not any(
133-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
133+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
134134
for n in shape_fn.maker.fgraph.apply_nodes
135135
)
136136
assert tuple(shape_fn(inp1_test, inp2_test)) == (7, 5, 3, 4)
137137

138138
shape_fn = pytensor.function([inp1, inp2], [outs[0].shape, outs[1].shape[:-1]])
139139
assert not any(
140-
isinstance(getattr(n.op, "core_op", n.op), TestOp)
140+
isinstance(getattr(n.op, "core_op", n.op), MyTestOp)
141141
for n in shape_fn.maker.fgraph.apply_nodes
142142
)
143143
assert tuple(shape_fn(inp1_test, inp2_test)[0]) == (7, 5, 3, 4)

0 commit comments

Comments
 (0)