Skip to content

Commit

Permalink
Bump flake8-bugbear from 22.12.6 to 23.1.14 (#647)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
Co-authored-by: Sam Bull <git@sambull.org>
  • Loading branch information
3 people committed Feb 9, 2023
1 parent 7c80a0f commit afa6659
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions aiocache/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __call__(self, f):
self.cache = caches.get(self.alias)
for arg in ("serializer", "namespace", "plugins"):
if getattr(self, f'_{arg}', None) is not None:
logger.warning(f"Using cache alias; ignoring '{arg}' argument.")
logger.warning(f"Using cache alias; ignoring {arg!r} argument.")
else:
self.cache = _get_cache(
cache=self._cache,
Expand Down Expand Up @@ -331,7 +331,7 @@ def __call__(self, f):
self.cache = caches.get(self.alias)
for arg in ("serializer", "namespace", "plugins"):
if getattr(self, f'_{arg}', None) is not None:
logger.warning(f"Using cache alias; ignoring '{arg}' argument.")
logger.warning(f"Using cache alias; ignoring {arg!r} argument.")
else:
self.cache = _get_cache(
cache=self._cache,
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

flake8==6.0.0
flake8-bandit==4.1.1
flake8-bugbear==22.12.6
flake8-bugbear==23.1.20
flake8-import-order==0.18.2
flake8-requirements==1.7.7
mypy==1.0.0; implementation_name=="cpython"
Expand Down
2 changes: 1 addition & 1 deletion tests/ut/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def reset_caches():

@pytest.fixture
def mock_cache(mocker):
return create_autospec(BaseCache, instance=True)
return create_autospec(BaseCache())


@pytest.fixture
Expand Down
12 changes: 6 additions & 6 deletions tests/ut/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ async def test_calls_fn_set_when_get_none(self, mocker, decorator, decorator_cal

async def test_calls_fn_raises_exception(self, decorator, decorator_call):
decorator.cache.get.return_value = None
stub.side_effect = Exception()
with pytest.raises(Exception):
stub.side_effect = Exception("foo")
with pytest.raises(Exception, match="foo"):
assert await decorator_call()

async def test_cache_write_waits_for_future(self, decorator, decorator_call):
Expand Down Expand Up @@ -284,8 +284,8 @@ async def test_calls_get_and_returns(self, decorator, decorator_call):

async def test_calls_fn_raises_exception(self, decorator, decorator_call):
decorator.cache.get.return_value = None
stub.side_effect = Exception()
with pytest.raises(Exception):
stub.side_effect = Exception("foo")
with pytest.raises(Exception, match="foo"):
assert await decorator_call()

async def test_calls_redlock(self, decorator, decorator_call):
Expand Down Expand Up @@ -492,8 +492,8 @@ async def test_calls_fn_with_only_missing_keys(self, mocker, decorator, decorato

async def test_calls_fn_raises_exception(self, decorator, decorator_call):
decorator.cache.multi_get.return_value = [None]
stub_dict.side_effect = Exception()
with pytest.raises(Exception):
stub_dict.side_effect = Exception("foo")
with pytest.raises(Exception, match="foo"):
assert await decorator_call(keys=[])

async def test_cache_read_disabled(self, decorator, decorator_call):
Expand Down

0 comments on commit afa6659

Please sign in to comment.