Skip to content

Commit 8ec1937

Browse files
committed
fix typing in test/test_commit_trailer.py
1 parent efc112a commit 8ec1937

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/test_commit_trailer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,31 @@
2323
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
2424
# Boston, MA 02110-1301, USA.
2525

26+
from pathlib import Path
27+
from typing import Generator
28+
2629
import pytest
2730

2831
import pygit2
32+
from pygit2 import Commit, Repository
2933

3034
from . import utils
3135

3236

3337
@pytest.fixture
34-
def repo(tmp_path):
38+
def repo(tmp_path: Path) -> Generator[Repository, None, None]:
3539
with utils.TemporaryRepository('trailerrepo.zip', tmp_path) as path:
3640
yield pygit2.Repository(path)
3741

3842

39-
def test_get_trailers_array(repo):
43+
def test_get_trailers_array(repo: Repository) -> None:
4044
commit_hash = '010231b2fdaee6b21da4f06058cf6c6a3392dd12'
4145
expected_trailers = {
4246
'Bug': '1234',
4347
'Signed-off-by': 'Tyler Cipriani <[email protected]>',
4448
}
4549
commit = repo.get(commit_hash)
50+
assert isinstance(commit, Commit)
4651
trailers = commit.message_trailers
4752

4853
assert trailers['Bug'] == expected_trailers['Bug']

0 commit comments

Comments
 (0)