Assignment from no return (#658)
* added unnecessary-dunder-call to pylintrc files; disabled for certain lines in run_tests.py, exception thrown by 'git remote add origin' when the remote already exists will not exit Signed-off-by: Mark Cohen <[email protected]> * updates to adhere to assignment-from-no-return lint Signed-off-by: Mark Cohen <[email protected]> * simplified get_value_filter in Facet to return None added assert to test get_value_filter returning None Signed-off-by: Mark Cohen <[email protected]> * added option to output HTML test coverage locally from run_tests.py returning None from test_faceted_search.Facet.get_value_filter Signed-off-by: Mark Cohen <[email protected]> * added unused-variable lints; replaced unused variables with _ or referenced them Signed-off-by: Mark Cohen <[email protected]> * updated CHANGELOG to point to the right PR Signed-off-by: Mark Cohen <[email protected]> --------- Signed-off-by: Mark Cohen <[email protected]>
This commit is contained in:
@@ -59,15 +59,13 @@ class FailingBulkClient(object):
|
||||
class TestStreamingBulk(OpenSearchTestCase):
|
||||
def test_actions_remain_unchanged(self) -> None:
|
||||
actions = [{"_id": 1}, {"_id": 2}]
|
||||
for ok, item in helpers.streaming_bulk(
|
||||
self.client, actions, index="test-index"
|
||||
):
|
||||
for ok, _ in helpers.streaming_bulk(self.client, actions, index="test-index"):
|
||||
self.assertTrue(ok)
|
||||
self.assertEqual([{"_id": 1}, {"_id": 2}], actions)
|
||||
|
||||
def test_all_documents_get_inserted(self) -> None:
|
||||
docs = [{"answer": x, "_id": x} for x in range(100)]
|
||||
for ok, item in helpers.streaming_bulk(
|
||||
for ok, _ in helpers.streaming_bulk(
|
||||
self.client, docs, index="test-index", refresh=True
|
||||
):
|
||||
self.assertTrue(ok)
|
||||
@@ -88,7 +86,7 @@ class TestStreamingBulk(OpenSearchTestCase):
|
||||
self.client.cluster.health(wait_for_status="yellow")
|
||||
|
||||
try:
|
||||
for ok, item in helpers.streaming_bulk(
|
||||
for ok, _ in helpers.streaming_bulk(
|
||||
self.client, [{"a": "b"}, {"a": "c"}], index="i", raise_on_error=True
|
||||
):
|
||||
self.assertTrue(ok)
|
||||
@@ -112,7 +110,7 @@ class TestStreamingBulk(OpenSearchTestCase):
|
||||
"doc": {"answer": 42},
|
||||
},
|
||||
]
|
||||
for ok, item in helpers.streaming_bulk(self.client, docs):
|
||||
for ok, _ in helpers.streaming_bulk(self.client, docs):
|
||||
self.assertTrue(ok)
|
||||
|
||||
self.assertFalse(self.client.exists(index="i", id=45))
|
||||
|
||||
@@ -176,6 +176,8 @@ def test_boolean_facet(data_client: Any, repo_search_cls: Any) -> None:
|
||||
assert [(True, 1, False)] == r.facets.public
|
||||
value, count, selected = r.facets.public[0]
|
||||
assert value is True
|
||||
assert count == 1
|
||||
assert selected is False
|
||||
|
||||
|
||||
def test_empty_search_finds_everything(
|
||||
|
||||
Reference in New Issue
Block a user