Skip to content

Commit 97e58b7

Browse files
fix: address pytest warnings without global filters (#192)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: William Easton <strawgate@users.noreply.github.com>
1 parent 17b8cd2 commit 97e58b7

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

key-value/key-value-aio/src/key_value/aio/stores/vault/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def _delete_managed_entry(self, *, key: str, collection: str) -> bool:
122122
try:
123123
# Vault doesnt tell us if the delete was successful so we read the entry and if it exists before we call delete,
124124
# we count it as a deletion.
125-
entry = self._kv_v2.read_secret(path=combo_key, mount_point=self._mount_point) # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
125+
entry = self._kv_v2.read_secret(path=combo_key, mount_point=self._mount_point, raise_on_deleted_version=True) # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
126126
self._kv_v2.delete_metadata_and_all_versions(path=combo_key, mount_point=self._mount_point) # pyright: ignore[reportUnknownMemberType]
127127
except InvalidPath:
128128
return False

key-value/key-value-aio/tests/stores/elasticsearch/test_elasticsearch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ async def test_put_put_two_indices(self, store: ElasticsearchStore, es_client: A
148148

149149

150150
@pytest.mark.skipif(should_skip_docker_tests(), reason="Docker is not running")
151+
@pytest.mark.filterwarnings("ignore:A configured store is unstable and may change in a backwards incompatible way. Use at your own risk.")
151152
class TestElasticsearchStoreNativeMode(BaseTestElasticsearchStore):
152153
"""Test Elasticsearch store in native mode (i.e. it stores flattened objects)"""
153154

@@ -207,6 +208,7 @@ async def test_migration_from_non_native_mode(self, store: ElasticsearchStore, e
207208

208209

209210
@pytest.mark.skipif(should_skip_docker_tests(), reason="Docker is not running")
211+
@pytest.mark.filterwarnings("ignore:A configured store is unstable and may change in a backwards incompatible way. Use at your own risk.")
210212
class TestElasticsearchStoreNonNativeMode(BaseTestElasticsearchStore):
211213
"""Test Elasticsearch store in non-native mode (i.e. it stores stringified JSON values)"""
212214

key-value/key-value-sync/src/key_value/sync/code_gen/stores/vault/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _delete_managed_entry(self, *, key: str, collection: str) -> bool:
119119
try:
120120
# Vault doesnt tell us if the delete was successful so we read the entry and if it exists before we call delete,
121121
# we count it as a deletion.
122-
entry = self._kv_v2.read_secret(path=combo_key, mount_point=self._mount_point) # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
122+
entry = self._kv_v2.read_secret(path=combo_key, mount_point=self._mount_point, raise_on_deleted_version=True) # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType]
123123
self._kv_v2.delete_metadata_and_all_versions(path=combo_key, mount_point=self._mount_point) # pyright: ignore[reportUnknownMemberType]
124124
except InvalidPath:
125125
return False

key-value/key-value-sync/tests/code_gen/stores/elasticsearch/test_elasticsearch.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def test_put_put_two_indices(self, store: ElasticsearchStore, es_client: Elastic
141141

142142

143143
@pytest.mark.skipif(should_skip_docker_tests(), reason="Docker is not running")
144+
@pytest.mark.filterwarnings("ignore:A configured store is unstable and may change in a backwards incompatible way. Use at your own risk.")
144145
class TestElasticsearchStoreNativeMode(BaseTestElasticsearchStore):
145146
"""Test Elasticsearch store in native mode (i.e. it stores flattened objects)"""
146147

@@ -189,6 +190,7 @@ def test_migration_from_non_native_mode(self, store: ElasticsearchStore, es_clie
189190

190191

191192
@pytest.mark.skipif(should_skip_docker_tests(), reason="Docker is not running")
193+
@pytest.mark.filterwarnings("ignore:A configured store is unstable and may change in a backwards incompatible way. Use at your own risk.")
192194
class TestElasticsearchStoreNonNativeMode(BaseTestElasticsearchStore):
193195
"""Test Elasticsearch store in non-native mode (i.e. it stores stringified JSON values)"""
194196

0 commit comments

Comments
 (0)