[tests] migrate test_hooks.py to pytest (#13242)
* move test_hooks.py to pytest
* Create `TestHooks` generator on `torch_device` (#13871)
Create TestHooks generator on device to avoid device mismatch errors
---------
Co-authored-by: dg845 <58458699+dg845@users.noreply.github.com>