Fixing test case depending on optional dependencies