Skip to content

Commit

Permalink
fix: report name of failing tag
Browse files Browse the repository at this point in the history
  • Loading branch information
msto committed Oct 17, 2023
1 parent d80b4a1 commit dcd566c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ def set_tag(
value: The value of the tag.
"""

assert len(tag) == 2, "Tags must be 2 characters."
assert len(tag) == 2, f"Tags must be 2 characters: {tag}."

for rec in self.all_recs():
rec.set_tag(tag, value)
Expand Down
2 changes: 1 addition & 1 deletion fgpyo/sam/tests/test_template_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ def test_set_tag() -> None:

# test tags that aren't two characters
for bad_tag in ["", "A", "ABC", "ABCD"]:
with pytest.raises(AssertionError, match="Tags must be 2 characters."):
with pytest.raises(AssertionError, match="Tags must be 2 characters"):
template.set_tag(bad_tag, VALUE)

0 comments on commit dcd566c

Please sign in to comment.