Add hooks for testing optional dependencies