Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump flake8-bugbear from 22.12.6 to 23.1.14 #647

Merged
merged 7 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aiocache/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 @@ -310,7 +310,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.6
mypy==0.991; 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