Skip to content

Commit

Permalink
[pytest] Don't return values from test_* functions (#14475)
Browse files Browse the repository at this point in the history
* [pytest] Don't return values from test_* functions

Pytest expects test functions to return None, and errors to be flagged
via exceptions. It actually emits warnings for "return" statements
encountered in test_ functions.

* Add explicit asserts

* Use not-None in assertion
  • Loading branch information
Krzysztof Parzyszek authored Apr 4, 2023
1 parent dba987c commit 579d999
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_cache_shape(self, ir_module, input_layout, working_layout, output_layou
assert len(buffer.shape) == expected_physical_dimensions

def test_lower(self, schedule_args):
return tvm.lower(*schedule_args)
assert tvm.lower(*schedule_args)

@requires_hexagon_toolchain
def test_build(self, schedule_args, target_host, input_layout, working_layout, output_layout):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_maxpool(self, shape_nhwc, window_size, stride, pad, dtype, target):
padding=(pad, pad, pad, pad),
dtype=dtype,
)
return output, ref_output
assert all([output is not None, ref_output is not None])


if __name__ == "__main__":
Expand Down

0 comments on commit 579d999

Please sign in to comment.