Use pytest.fixture to simplify tests.

parametrize tests on cache in one file rather than repeat tests in two files.