gemini-code-assist[bot] commented on code in PR #18821:
URL: https://github.com/apache/tvm/pull/18821#discussion_r2853187309


##########
tests/scripts/release/make_notes.py:
##########
@@ -218,7 +218,7 @@ def pr_title(number, heading):
         try:
             title = pr_dict[int(number)]["title"]
             title = strip_header(title, heading)
-        except:
+        except Exception:
             sprint("The out.pkl file is not match with csv file.")
             exit(1)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   While `except Exception:` is an improvement, it's good practice to be more 
specific about the exceptions you expect to catch. In this case, `int(number)` 
could raise a `ValueError` and `pr_dict[...]` could raise a `KeyError`. 
Catching `(ValueError, KeyError)` would make the error handling more precise.
   
   ```suggestion
           except (ValueError, KeyError):
               sprint("The out.pkl file is not match with csv file.")
               exit(1)
   ```



##########
tests/python/contrib/test_hexagon/test_run_unit_tests.py:
##########
@@ -151,7 +151,7 @@ def test_run_unit_tests(hexagon_session: Session, 
gtest_args, unit_test_name):
     """Try running gtest unit tests and capture output and error code"""
     try:
         func = hexagon_session._rpc.get_function("hexagon.run_unit_tests")
-    except:
+    except Exception:
         print(
             "This test requires TVM Runtime to be built with a Hexagon gtest"
             "version using Hexagon API cmake flag"

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Instead of just printing a message, it's better to use `pytest.skip` to 
explicitly mark the test as skipped. This provides clearer test results and 
avoids the test passing silently or failing with a subsequent `NameError` if 
`func` is used later. You'll need to `import pytest` at the top of the file.
   
   ```python
           pytest.skip(
               "This test requires TVM Runtime to be built with a Hexagon 
gtest" 
               "version using Hexagon API cmake flag"
           )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to