Lee-W commented on code in PR #55659:
URL: https://github.com/apache/airflow/pull/55659#discussion_r2356972712


##########
task-sdk/tests/task_sdk/definitions/test_asset_decorators.py:
##########
@@ -115,20 +115,17 @@ def root_func():
             def asset_func():
                 pass
 
-        with pytest.raises(ValueError) as err:
+        with pytest.raises(ValueError, match="nested function not supported"):
             root_func()
 
-        assert err.value.args[0] == "nested function not supported"
-
     @pytest.mark.parametrize("func_fixer", ("self", "context"), indirect=True)
     def test_with_invalid_asset_name(self, func_fixer):
         @func_fixer
         def example_asset_func():
             pass
 
-        with pytest.raises(ValueError) as err:
+        with pytest.raises(ValueError, match="prohibited name for asset"):

Review Comment:
   ```suggestion
           with pytest.raises(ValueError, match="prohibited name for asset: 
{func_fixer.fixed_name}"):
   ```
   
   



-- 
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]

Reply via email to