Open lordsoffallen opened 1 month ago
Hi @lordsoffallen thanks for raising this issue. Can I ask why you want to test the hook specifically? Usually you wouldn't add tests for third party components, but more on the part of the code using that. In this case I'm also wondering if unit tests are the most suitable or if an e2e setup where you run the pipeline is better.
So I want test that integration between my hook and kedro works as expected. This removes unexpected issues later.
I also noticed that (*args, **kwargs) pattern don't work in hooks, that i need to specify the parameter name itself. Basically, I wanna make sure my custom and kedro wiring works correct as expected
Description
Kedro hooks testing isn't straightforward. I had some issues testing it. Also doing
def f(*args, **kwargs)
on hooks doesn't work but if we define the variable we want to access it works such asdef f(conf_creds)
I think some guidelines on documentation on how a user can test hook function would be useful
Context
conftest.py
test_run.py
hooks.py
Trying this and debugger doesn't stop as hook code. I don't see print statements when i run as well. This code only works when I run through a session.
Following works:
Possible Implementation
Possible Alternatives