@@ -28,7 +28,7 @@ class _MockPullRequest:
2828
2929
3030class Test_ChangeNote :
31- def test_from_pull_requests (self , caplog ):
31+ def test_from_pull_requests_multiple (self , caplog ):
3232 caplog .set_level ("DEBUG" )
3333 body = """
3434Some ignored text in the pull request body.
@@ -68,3 +68,24 @@ def test_from_pull_requests(self, caplog):
6868 assert len (caplog .records ) == 1
6969 assert caplog .records [0 ].levelname == "DEBUG"
7070 assert "falling back to PR labels for summary" in caplog .records [0 ].msg
71+
72+ def test_from_pull_requests_fallback_title (self , caplog ):
73+ caplog .set_level ("DEBUG" )
74+ pull_request = _MockPullRequest (
75+ title = 'The title {label="ignored in title"}' ,
76+ body = "Nothing here." ,
77+ labels = [_MockLabel ("Documentation" )],
78+ )
79+ notes = ChangeNote .from_pull_requests (
80+ [pull_request ],
81+ pr_summary_regex = DEFAULT_CONFIG ["pr_summary_regex" ],
82+ pr_summary_label_regex = DEFAULT_CONFIG ["pr_summary_label_regex" ],
83+ )
84+ assert len (notes ) == 1
85+ notes = sorted (notes , key = lambda n : n .content )
86+ assert notes [0 ].content == 'The title {label="ignored in title"}'
87+ assert notes [0 ].labels == ("Documentation" ,)
88+
89+ assert len (caplog .records ) == 1
90+ assert caplog .records [0 ].levelname == "DEBUG"
91+ assert "falling back to title" in caplog .records [0 ].msg
0 commit comments