Skip to content

Commit

Permalink
BaseCache._close() raises NotImplementedError
Browse files Browse the repository at this point in the history
  • Loading branch information
padraic-shafer committed Mar 4, 2023
1 parent 604b00d commit 8caa687
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aiocache/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ async def close(self, *args, _conn=None, **kwargs):

@abstractmethod
async def _close(self, *args, **kwargs):
pass
raise NotImplementedError()

@abstractmethod
def build_key(self, key: str, namespace: Optional[str] = None) -> CacheKeyType:
Expand Down
3 changes: 2 additions & 1 deletion tests/ut/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ async def test_raw(self, base_cache):
await base_cache._raw("get", Keys.KEY)

async def test_close(self, base_cache):
assert await base_cache._close() is None
with pytest.raises(NotImplementedError):
await base_cache._close()

async def test_acquire_conn(self, base_cache):
assert await base_cache.acquire_conn() == base_cache
Expand Down

0 comments on commit 8caa687

Please sign in to comment.