Skip to content

Commit 115a8da

Browse files
committed
Fix Test Mismatch for Branch Ticket in Verbose
Note about missing branch ticket ID only shows in verbose mode. Update tests to reflect this.
1 parent bda4983 commit 115a8da

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

tests/test_cli.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,14 +652,12 @@ def test_cli_no_ticket_in_branch(self, capsys):
652652
mock_run.return_value = mock_result
653653

654654
with pytest.raises(SystemExit) as exc_info:
655-
main(["-j", "MYJIRA", test_file])
655+
main(["-j", "MYJIRA", "-v", test_file])
656656

657657
assert exc_info.value.code == 0
658658
captured = capsys.readouterr()
659659
# Should show informational message about no ticket
660-
assert (
661-
"Note: No ticket ID detected in current branch 'main'" in captured.out
662-
)
660+
assert "No ticket ID detected in current branch 'main'" in captured.out
663661

664662
def test_cli_git_detection_failure(self, capsys):
665663
"""Test CLI when git branch detection fails."""

tests/test_end_to_end.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,14 @@ def test_branch_without_ticket_shows_note(self, capsys):
7575
mock_run.return_value = mock_result
7676

7777
with pytest.raises(SystemExit) as exc_info:
78-
main(["-j", "LIBSDC", temp_file])
78+
main(["-j", "LIBSDC", "-v", temp_file])
7979

8080
assert exc_info.value.code == 0 # No violations
8181

8282
captured = capsys.readouterr()
8383

8484
# Should show note about no ticket in branch
85-
assert (
86-
"Note: No ticket ID detected in current branch 'main'"
87-
in captured.out
88-
)
85+
assert "No ticket ID detected in current branch 'main'" in captured.out
8986

9087
# Should not show any yellow warnings
9188
assert (

0 commit comments

Comments
 (0)