File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 44import os
55import os .path
66import sys
7+ import warnings
78
89from pathlib import Path
910from subprocess import PIPE , Popen , call
@@ -293,8 +294,10 @@ def test_get_default_compare_branch_main(self):
293294
294295 def test_get_default_compare_branch_fallback (self ):
295296 """
296- If there's origin/master and no main, use it.
297+ If there's origin/master and no main, use it and warn about it .
297298 """
298- branch = check ._get_default_compare_branch (["origin/master" , "origin/foo" ])
299+ with warnings .catch_warnings (record = True ) as w :
300+ branch = check ._get_default_compare_branch (["origin/master" , "origin/foo" ])
299301
300302 self .assertEqual ("origin/master" , branch )
303+ self .assertTrue (w [0 ].message .args [0 ].startswith ('Using "origin/master' ))
You can’t perform that action at this time.
0 commit comments