Skip to content

Commit 2c885fc

Browse files
committed
Make linter and formatter happy
1 parent 3ad3f43 commit 2c885fc

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

plantuml_sequence/diagram.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def __str__(self) -> str:
4444

4545
alias_suffix = "" if self.title == self.alias else f" as {self.alias}"
4646

47-
return f"{self.shape} {utils.escape_newlines(quoted_title)}{alias_suffix}{_format_color_cmd(self.background_color)}"
47+
return (
48+
f"{self.shape} {utils.escape_newlines(quoted_title)}{alias_suffix}"
49+
f"{_format_color_cmd(self.background_color)}"
50+
)
4851

4952

5053
ParticipantOrName: TypeAlias = Participant | str

test/test_examples.py

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,12 @@ def test_remove_footbox() -> None:
632632

633633
def test_some_other_notes() -> None:
634634
"""Test notes relative to participants, across all participants with and without colors"""
635-
with string_io() as file_like, Diagram(
636-
file_like,
637-
) as sequence:
635+
with (
636+
string_io() as file_like,
637+
Diagram(
638+
file_like,
639+
) as sequence,
640+
):
638641
alice = sequence.declare_participant("Alice")
639642
bob = sequence.declare_participant("Bob")
640643
sequence.participant_note(
@@ -664,19 +667,26 @@ def test_some_other_notes() -> None:
664667
def test_note_multiple_participants_left_and_right_raises() -> None:
665668
"""Test that the creation of notes `left of` or `right of` multiple participants fails"""
666669
for position in ("left", "right"):
667-
with pytest.raises(ValueError), string_io() as file_like, Diagram(
668-
file_like,
669-
) as sequence:
670+
with (
671+
pytest.raises(ValueError),
672+
string_io() as file_like,
673+
Diagram(
674+
file_like,
675+
) as sequence,
676+
):
670677
sequence.participant_note(["Alice", "Bob"], "This is displayed\nleft of Alice.", position=position)
671678

672679

673680
def test_notes_on_messages() -> None:
674681
"""Test notes relative to messages"""
675682
alice = "Alice"
676683
bob = "Bob"
677-
with string_io() as file_like, Diagram(
678-
file_like,
679-
) as sequence:
684+
with (
685+
string_io() as file_like,
686+
Diagram(
687+
file_like,
688+
) as sequence,
689+
):
680690
(
681691
sequence.message(alice, bob, "hello", note="this is a first note", note_position="left")
682692
.blank_line()
@@ -709,9 +719,12 @@ def test_notes_across_all_participants() -> None:
709719
alice = "Alice"
710720
bob = "Bob"
711721
charlie = "Charlie"
712-
with string_io() as file_like, Diagram(
713-
file_like,
714-
) as sequence:
722+
with (
723+
string_io() as file_like,
724+
Diagram(
725+
file_like,
726+
) as sequence,
727+
):
715728
(
716729
sequence.message(alice, bob, "m1")
717730
.message(bob, charlie, "m2")

0 commit comments

Comments
 (0)