def test_context_manager(self, cache): """ ensure the context manager reverts changes """ context = corr._Context(cache, 'default') old_default = cache['default'] new_val = corr.numpy_normxcorr with context(new_val): assert cache['default'] == new_val assert old_default
def set_xcorr(self, cache): return corr._Context(cache, 'default')