diff --git a/tests/cli/test_multiprocessing.py b/tests/cli/test_multiprocessing.py index 5d3f668bf..6621551b8 100644 --- a/tests/cli/test_multiprocessing.py +++ b/tests/cli/test_multiprocessing.py @@ -50,8 +50,8 @@ async def test_backpressure(): await releaser.__anext__() # Ensure stop iteration works - for _i in range(10): - with pytest.raises(StopAsyncIteration): + with pytest.raises(StopAsyncIteration): # noqa: PT012 + for _i in range(10): await releaser.__anext__() assert not backpressure.back_pressure.locked() diff --git a/tests/stores/test_advanced_stores.py b/tests/stores/test_advanced_stores.py index a1b0f967e..c0522a4fc 100644 --- a/tests/stores/test_advanced_stores.py +++ b/tests/stores/test_advanced_stores.py @@ -96,8 +96,8 @@ def test_mgrant_init(): with pytest.raises(StoreError): store = MongograntStore("", "", username="") - store = MongograntStore("", "") - with pytest.raises(ValueError): + with pytest.raises(ValueError): # noqa: PT012 + store = MongograntStore("", "") store.connect() diff --git a/tests/stores/test_mongolike.py b/tests/stores/test_mongolike.py index 9000c7dcb..68784a639 100644 --- a/tests/stores/test_mongolike.py +++ b/tests/stores/test_mongolike.py @@ -209,8 +209,8 @@ def test_mongostore_last_updated(mongostore): assert mongostore.last_updated == datetime.min start_time = datetime.utcnow() mongostore._collection.insert_one({mongostore.key: 1, "a": 1}) - # mongostore.last_updated - with pytest.raises(StoreError) as cm: + with pytest.raises(StoreError) as cm: # noqa: PT012 + mongostore.last_updated # noqa: B018 assert cm.match(mongostore.last_updated_field) mongostore.update([{mongostore.key: 1, "a": 1, mongostore.last_updated_field: datetime.utcnow()}]) assert mongostore.last_updated > start_time @@ -399,8 +399,8 @@ def test_monty_store_last_updated(montystore): assert montystore.last_updated == datetime.min start_time = datetime.utcnow() montystore._collection.insert_one({montystore.key: 1, "a": 1}) - montystore.last_updated # noqa: B018 - with pytest.raises(StoreError) as cm: + with pytest.raises(StoreError) as cm: # noqa: PT012 + montystore.last_updated # noqa: B018 assert cm.match(montystore.last_updated_field) montystore.update([{montystore.key: 1, "a": 1, montystore.last_updated_field: datetime.utcnow()}]) assert montystore.last_updated > start_time