Skip to content

Commit 3d83a19

Browse files
committed
style: format proto-plus code with black
1 parent 4b24553 commit 3d83a19

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/proto-plus/proto/message.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,6 @@ def __init__(
688688
)
689689
) from e
690690

691-
692691
def _get_pb_type_from_key(self, key):
693692
"""Given a key, return the corresponding pb_type.
694693
@@ -877,8 +876,6 @@ def __setattr__(self, key, value):
877876
)
878877
) from e
879878

880-
881-
882879
def __getstate__(self):
883880
"""Serialize for pickling."""
884881
return self._pb.SerializeToString()

packages/proto-plus/tests/test_message.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ def test_dir_message_base():
504504

505505
def test_invalid_initialization_type_error():
506506
"""Verify that bad types passed to __init__ raise a descriptive TypeError."""
507+
507508
class UserProfile(proto.Message):
508509
username = proto.Field(proto.STRING, number=1)
509510
age = proto.Field(proto.INT32, number=2)
@@ -520,9 +521,11 @@ class UserProfile(proto.Message):
520521

521522
def test_invalid_assignment_type_error():
522523
"""Verify that bad types assigned via __setattr__ raise a descriptive TypeError."""
524+
523525
class UserProfile(proto.Message):
524526
username = proto.Field(proto.STRING, number=1)
525527
age = proto.Field(proto.INT32, number=2)
528+
526529
profile = UserProfile()
527530

528531
with pytest.raises(TypeError) as excinfo:
@@ -532,4 +535,4 @@ class UserProfile(proto.Message):
532535
error_msg = str(excinfo.value)
533536
assert "Failed to set field 'age' on UserProfile" in error_msg
534537
assert "{'invalid': 'type'}" in error_msg
535-
assert isinstance(excinfo.value.__cause__, TypeError)
538+
assert isinstance(excinfo.value.__cause__, TypeError)

0 commit comments

Comments
 (0)