Refactor `test_isolate_method`

* Instantiate `isolate_method` before using it as a context manager