Skip to content

Commit

Permalink
fix black formatting for new version
Browse files Browse the repository at this point in the history
Signed-off-by: Philip May <[email protected]>
  • Loading branch information
PhilipMay authored and VijayanB committed Feb 5, 2022
1 parent 8b5a1ca commit 4056fa0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test_opensearchpy/test_async/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ async def test_surrogatepass_into_bytes(self):
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", "/")
assert u"你好\uda6a" == data
assert u"你好\uda6a" == data # fmt: skip

@pytest.mark.parametrize("exception_cls", reraise_exceptions)
async def test_recursion_error_reraised(self, exception_cls):
Expand Down
4 changes: 2 additions & 2 deletions test_opensearchpy/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_surrogatepass_into_bytes(self):
buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa"
con = self._get_mock_connection(response_body=buf)
status, headers, data = con.perform_request("GET", "/")
self.assertEqual(u"你好\uda6a", data)
self.assertEqual(u"你好\uda6a", data) # fmt: skip

@pytest.mark.skipif(
not reraise_exceptions, reason="RecursionError isn't defined in Python <3.5"
Expand Down Expand Up @@ -696,7 +696,7 @@ def test_surrogatepass_into_bytes(self):
buf = b"\xe4\xbd\xa0\xe5\xa5\xbd\xed\xa9\xaa"
con = self._get_mock_connection(response_body=buf)
status, headers, data = con.perform_request("GET", "/")
self.assertEqual(u"你好\uda6a", data)
self.assertEqual(u"你好\uda6a", data) # fmt: skip

@pytest.mark.skipif(
not reraise_exceptions, reason="RecursionError isn't defined in Python <3.5"
Expand Down
4 changes: 2 additions & 2 deletions test_opensearchpy/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_chunk_sent_from_different_threads(self, _process_bulk_chunk):

class TestChunkActions(TestCase):
def setup_method(self, _):
self.actions = [({"index": {}}, {"some": u"datá", "i": i}) for i in range(100)]
self.actions = [({"index": {}}, {"some": u"datá", "i": i}) for i in range(100)] # fmt: skip

def test_expand_action(self):
self.assertEqual(helpers.expand_action({}), ({"index": {}}, {}))
Expand Down Expand Up @@ -209,7 +209,7 @@ def test_chunks_are_chopped_by_byte_size_properly(self):
)
self.assertEqual(25, len(chunks))
for chunk_data, chunk_actions in chunks:
chunk = u"".join(chunk_actions)
chunk = u"".join(chunk_actions) # fmt: skip
chunk = chunk if isinstance(chunk, str) else chunk.encode("utf-8")
self.assertLessEqual(len(chunk), max_byte_size)

Expand Down
12 changes: 4 additions & 8 deletions utils/generate-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,10 @@ def dump_modules(modules):
filepaths = []
for root, _, filenames in os.walk(CODE_ROOT / "opensearchpy/_async"):
for filename in filenames:
if (
filename.rpartition(".")[-1]
in (
"py",
"pyi",
)
and not filename.startswith("utils.py")
):
if filename.rpartition(".")[-1] in (
"py",
"pyi",
) and not filename.startswith("utils.py"):
filepaths.append(os.path.join(root, filename))

unasync.unasync_files(filepaths, rules)
Expand Down

0 comments on commit 4056fa0

Please sign in to comment.