Skip to content

Commit

Permalink
-B break change, empty header in verifyAll is handled better
Browse files Browse the repository at this point in the history
Co-Authored-By: Nitsan Avni <nitsanav@gmail.com>
Co-Authored-By: Samuel Taggart <Samuel.Taggart@gmail.com>
  • Loading branch information
3 people committed Feb 25, 2024
1 parent 2c04160 commit 73e4a4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion approval_utilities/list_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def format_list(alist: List[str], formatter: Optional[Callable], header: str) -> str:
if formatter is None:
formatter = FormatLineItem().print_item
text = header + "\n\n"
text = (header + "\n\n") if header else ""
for i in alist:
text += formatter(i) + "\n"
return text
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@


move "a.text" "r.txt"
mv -f a.text r.txt
10 changes: 10 additions & 0 deletions tests/test_verify_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from approvaltests import Options, verify_all


def test_verify_all_with_no_header():
"""
0) 1
1) 2
2) 3
"""
verify_all("", ["1", "2", "3"],options=Options().inline())

0 comments on commit 73e4a4f

Please sign in to comment.