Skip to content

Commit 80d5f0a

Browse files
committed
resolve comment
1 parent ee52086 commit 80d5f0a

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tests/benchmarks/micro_benchmarks/test_gpu_stream.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,12 @@ def _test_gpu_stream_result_parsing(self, platform, test_raw_output):
103103
assert (len(benchmark.result[output_key]) == 1)
104104
assert (isinstance(benchmark.result[output_key][0], numbers.Number))
105105
if output_key.endswith('_bw'):
106-
assert (output_key.removesuffix('_bw') in test_raw_output_dict)
107-
assert (test_raw_output_dict[output_key.removesuffix('_bw')][0] == benchmark.result[output_key][0])
106+
assert (output_key[:-3] in test_raw_output_dict)
107+
assert (test_raw_output_dict[output_key[:-3]][0] == benchmark.result[output_key][0])
108108
else:
109-
assert (output_key.removesuffix('_ratio') in test_raw_output_dict)
110-
assert (
111-
test_raw_output_dict[output_key.removesuffix('_ratio')][1] == benchmark.result[output_key][0]
112-
)
109+
assert (output_key.endswith('_ratio'))
110+
assert (output_key[:-6] in test_raw_output_dict)
111+
assert (test_raw_output_dict[output_key[:-6]][1] == benchmark.result[output_key][0])
113112

114113
# Negative case - invalid raw output.
115114
assert (benchmark._process_raw_result(1, 'Invalid raw output') is False)
@@ -150,13 +149,12 @@ def _test_gpu_stream_result_parsing_float(self, platform, test_raw_output):
150149
assert (len(benchmark.result[output_key]) == 1)
151150
assert (isinstance(benchmark.result[output_key][0], numbers.Number))
152151
if output_key.endswith('_bw'):
153-
assert (output_key.removesuffix('_bw') in test_raw_output_dict)
154-
assert (test_raw_output_dict[output_key.removesuffix('_bw')][0] == benchmark.result[output_key][0])
152+
assert (output_key[:-3] in test_raw_output_dict)
153+
assert (test_raw_output_dict[output_key[:-3]][0] == benchmark.result[output_key][0])
155154
else:
156-
assert (output_key.removesuffix('_ratio') in test_raw_output_dict)
157-
assert (
158-
test_raw_output_dict[output_key.removesuffix('_ratio')][1] == benchmark.result[output_key][0]
159-
)
155+
assert (output_key.endswith('_ratio'))
156+
assert (output_key[:-6] in test_raw_output_dict)
157+
assert (test_raw_output_dict[output_key[:-6]][1] == benchmark.result[output_key][0])
160158

161159
@decorator.cuda_test
162160
def test_gpu_stream_result_parsing_cuda_float(self):

0 commit comments

Comments
 (0)