Skip to content

Commit 6f74f12

Browse files
Refactor tests to prevent Kgb warning
1 parent dbe9e76 commit 6f74f12

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

backends/nxp/tests/ir/converter/node_converter/test_addmm_converter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def setUpClass(cls):
3030

3131
def test_addmm_conversion(self):
3232
with kgb.spy_on(
33-
EdgeProgramToIRConverter.convert_program, call_original=True
33+
EdgeProgramToIRConverter.convert_program,
34+
call_original=True,
35+
owner=EdgeProgramToIRConverter,
3436
) as converter_spy:
3537
input_shape = (1, 32)
3638
model = AddmmModule(input_shape[1])
@@ -60,7 +62,9 @@ def test_addmm_conversion(self):
6062

6163
def test_linear_conversion__with_bias(self):
6264
with kgb.spy_on(
63-
EdgeProgramToIRConverter.convert_program, call_original=True
65+
EdgeProgramToIRConverter.convert_program,
66+
call_original=True,
67+
owner=EdgeProgramToIRConverter,
6468
) as converter_spy:
6569
input_shape = (10, 32)
6670
model = LinearModule(bias=True)

backends/nxp/tests/ir/converter/node_converter/test_clone_converter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def test_conv_dropout_quant(self, inplace_dropout: bool, input_shape: tuple[int]
108108
).eval()
109109

110110
with kgb.spy_on(
111-
EdgeProgramToIRConverter.convert_program, call_original=True
111+
EdgeProgramToIRConverter.convert_program,
112+
call_original=True,
113+
owner=EdgeProgramToIRConverter,
112114
) as converter_spy:
113115
quantized_program = to_quantized_edge_program(
114116
model, input_shape
@@ -159,7 +161,9 @@ def test_clone_pool_view_copy_quant(self, input_shape: tuple[int] = (1, 64, 25,
159161
model = KWSFinalBlock(input_shape).eval()
160162

161163
with kgb.spy_on(
162-
EdgeProgramToIRConverter.convert_program, call_original=True
164+
EdgeProgramToIRConverter.convert_program,
165+
call_original=True,
166+
owner=EdgeProgramToIRConverter,
163167
) as converter_spy:
164168
quantized_program = to_quantized_edge_program(
165169
model, input_shape

backends/nxp/tests/ir/converter/node_converter/test_mm_converter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def setUpClass(cls):
3030

3131
def test_mm_conversion(self):
3232
with kgb.spy_on(
33-
EdgeProgramToIRConverter.convert_program, call_original=True
33+
EdgeProgramToIRConverter.convert_program,
34+
call_original=True,
35+
owner=EdgeProgramToIRConverter,
3436
) as converter_spy:
3537
input_shape = (1, 32)
3638
model = MmModule(input_shape[1])
@@ -60,7 +62,9 @@ def test_mm_conversion(self):
6062

6163
def test_linear_conversion__without_bias(self):
6264
with kgb.spy_on(
63-
EdgeProgramToIRConverter.convert_program, call_original=True
65+
EdgeProgramToIRConverter.convert_program,
66+
call_original=True,
67+
owner=EdgeProgramToIRConverter,
6468
) as converter_spy:
6569
input_shape = (10, 32)
6670
model = LinearModule(bias=False)

backends/nxp/tests/ir/converter/node_converter/test_tanh_converter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def test_conv_tanh(
4848
self, _: str, inplace: bool, input_shape: tuple[int] = (1, 3, 112, 112)
4949
):
5050
with kgb.spy_on(
51-
EdgeProgramToIRConverter.convert_program, call_original=True
51+
EdgeProgramToIRConverter.convert_program,
52+
call_original=True,
53+
owner=EdgeProgramToIRConverter,
5254
) as converter_spy:
5355
if inplace:
5456
model = Conv2dWithActivation(

backends/nxp/tests/test_per_channel_conversion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ def setUpClass(cls):
110110

111111
def test_per_channel_convolution(self):
112112
with kgb.spy_on(
113-
EdgeProgramToIRConverter.convert_program, call_original=True
113+
EdgeProgramToIRConverter.convert_program,
114+
call_original=True,
115+
owner=EdgeProgramToIRConverter,
114116
) as converter_spy:
115117
model = Conv2dModule(
116118
in_channels=8, out_channels=32, kernel_size=5, padding=3

0 commit comments

Comments
 (0)