Skip to content

Commit

Permalink
Merge pull request #434 from twisted/master-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Sep 28, 2022
2 parents d394d77 + ff5b206 commit e36a8ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Empty file.
7 changes: 5 additions & 2 deletions src/towncrier/test/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import os.path
import sys
import warnings

from pathlib import Path
from subprocess import PIPE, Popen, call
Expand Down Expand Up @@ -293,8 +294,10 @@ def test_get_default_compare_branch_main(self):

def test_get_default_compare_branch_fallback(self):
"""
If there's origin/master and no main, use it.
If there's origin/master and no main, use it and warn about it.
"""
branch = check._get_default_compare_branch(["origin/master", "origin/foo"])
with warnings.catch_warnings(record=True) as w:
branch = check._get_default_compare_branch(["origin/master", "origin/foo"])

self.assertEqual("origin/master", branch)
self.assertTrue(w[0].message.args[0].startswith('Using "origin/master'))

0 comments on commit e36a8ca

Please sign in to comment.