Pull cache test patterns into reusable contextmanagers

trigger CI