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:
@@ -341,7 +341,7 @@ class TestAIOHttpConnection:
|
||||
async def test_surrogatepass_into_bytes(self) -> None:
|
||||
buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa"
|
||||
con = await self._get_mock_connection(response_body=buf)
|
||||
status, headers, data = await con.perform_request("GET", "/")
|
||||
_, _, data = await con.perform_request("GET", "/")
|
||||
assert u"你好\uda6a" == data # fmt: skip
|
||||
|
||||
@pytest.mark.parametrize("exception_cls", reraise_exceptions) # type: ignore
|
||||
@@ -394,7 +394,7 @@ class TestConnectionHttpServer:
|
||||
cls.server.stop()
|
||||
|
||||
async def httpserver(self, conn: Any, **kwargs: Any) -> Any:
|
||||
status, headers, data = await conn.perform_request("GET", "/", **kwargs)
|
||||
status, _, data = await conn.perform_request("GET", "/", **kwargs)
|
||||
data = json.loads(data)
|
||||
return (status, data)
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class FailingBulkClient(object):
|
||||
class TestStreamingBulk(object):
|
||||
async def test_actions_remain_unchanged(self, async_client: Any) -> None:
|
||||
actions1 = [{"_id": 1}, {"_id": 2}]
|
||||
async for ok, item in actions.async_streaming_bulk(
|
||||
async for ok, _ in actions.async_streaming_bulk(
|
||||
async_client, actions1, index="test-index"
|
||||
):
|
||||
assert ok
|
||||
@@ -80,7 +80,7 @@ class TestStreamingBulk(object):
|
||||
|
||||
async def test_all_documents_get_inserted(self, async_client: Any) -> None:
|
||||
docs = [{"answer": x, "_id": x} for x in range(100)]
|
||||
async for ok, item in actions.async_streaming_bulk(
|
||||
async for ok, _ in actions.async_streaming_bulk(
|
||||
async_client, docs, index="test-index", refresh=True
|
||||
):
|
||||
assert ok
|
||||
@@ -100,7 +100,7 @@ class TestStreamingBulk(object):
|
||||
for x in range(100):
|
||||
yield {"answer": x, "_id": x}
|
||||
|
||||
async for ok, item in actions.async_streaming_bulk(
|
||||
async for ok, _ in actions.async_streaming_bulk(
|
||||
async_client, async_gen(), index="test-index", refresh=True
|
||||
):
|
||||
assert ok
|
||||
@@ -114,7 +114,7 @@ class TestStreamingBulk(object):
|
||||
index="test-index", body={"query": {"match_all": {}}}
|
||||
)
|
||||
|
||||
async for ok, item in actions.async_streaming_bulk(
|
||||
async for ok, _ in actions.async_streaming_bulk(
|
||||
async_client, sync_gen(), index="test-index", refresh=True
|
||||
):
|
||||
assert ok
|
||||
@@ -137,7 +137,7 @@ class TestStreamingBulk(object):
|
||||
await async_client.cluster.health(wait_for_status="yellow")
|
||||
|
||||
try:
|
||||
async for ok, item in actions.async_streaming_bulk(
|
||||
async for ok, _ in actions.async_streaming_bulk(
|
||||
async_client, [{"a": "b"}, {"a": "c"}], index="i", raise_on_error=True
|
||||
):
|
||||
assert ok
|
||||
@@ -154,7 +154,7 @@ class TestStreamingBulk(object):
|
||||
{"_op_type": "delete", "_index": "i", "_id": 45},
|
||||
{"_op_type": "update", "_index": "i", "_id": 42, "doc": {"answer": 42}},
|
||||
]
|
||||
async for ok, item in actions.async_streaming_bulk(async_client, docs):
|
||||
async for ok, _ in actions.async_streaming_bulk(async_client, docs):
|
||||
assert ok
|
||||
|
||||
assert not await async_client.exists(index="i", id=45)
|
||||
|
||||
@@ -170,7 +170,7 @@ async def test_boolean_facet(data_client: Any, repo_search_cls: Any) -> None:
|
||||
|
||||
assert r.hits.total.value == 1
|
||||
assert [(True, 1, False)] == r.facets.public
|
||||
value, count, selected = r.facets.public[0]
|
||||
value, _, _ = r.facets.public[0]
|
||||
assert value is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user