Add pytest fixture to control optional dependency
When a method depends on an optional dependency, we want to test behavior that relies on it being installed & not installed. Right now, we have to add skips for both cases

1. Test behavior when installed, skip if not installed
2. Test behavior when not installed, skip if installed

Ideally, we would always test the second, by simulating a missing dependency. Unfortunately, python's caching of imports makes this somewhat difficult to achieve. Hopefully it doesn't require writing a custom importer: https://docs.python.org/3/library/importlib.html#introduction