fix test_keyfile

keyfile is not part of cache keys so the expectations are wrong.

We don't make it part of cache keys because we don't expect keyfile to
affect the version as long as we can get it.
This commit is contained in:
lilydjwg 2018-10-10 17:17:02 +08:00
parent 26eaef92aa
commit 10e3478b12
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import io
import structlog
from nvchecker.get_version import get_version as _get_version
from nvchecker.get_version import _cache
from nvchecker.core import Source
class TestSource(Source):
@ -22,7 +23,10 @@ class TestSource(Source):
self._future.set_exception(exc)
@pytest.fixture(scope="module")
async def run_source():
async def run_source(*, clear_cache=False):
if clear_cache:
_cache.clear()
async def __call__(conf):
future = asyncio.Future()
file = io.StringIO(conf)

View File

@ -46,7 +46,7 @@ keyfile = {name}
'''.format(name=f.name)
try:
version = await run_source(test_conf)
version = await run_source(test_conf, clear_cache=True)
assert version is None # out of allowance
return
except HTTPError as e: