Could you test only once and remember it and then reuse it at later invocations? You could simply store to a top-level variable results of tests.