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+
2629import pytest
2730
2831import pygit2
32+ from pygit2 import Oid , Repository
2933from pygit2 .enums import FetchPrune
3034
3135
3236@pytest .fixture
33- def clonerepo (testrepo , tmp_path ):
37+ def clonerepo (
38+ testrepo : Repository , tmp_path : Path
39+ ) -> Generator [Repository , None , None ]:
3440 cloned_repo_path = tmp_path / 'test_remote_prune'
3541
3642 pygit2 .clone_repository (testrepo .workdir , cloned_repo_path )
@@ -39,26 +45,26 @@ def clonerepo(testrepo, tmp_path):
3945 yield clonerepo
4046
4147
42- def test_fetch_remote_default (clonerepo ) :
48+ def test_fetch_remote_default (clonerepo : Repository ) -> None :
4349 clonerepo .remotes [0 ].fetch ()
4450 assert 'origin/i18n' in clonerepo .branches
4551
4652
47- def test_fetch_remote_prune (clonerepo ) :
53+ def test_fetch_remote_prune (clonerepo : Repository ) -> None :
4854 clonerepo .remotes [0 ].fetch (prune = FetchPrune .PRUNE )
4955 assert 'origin/i18n' not in clonerepo .branches
5056
5157
52- def test_fetch_no_prune (clonerepo ) :
58+ def test_fetch_no_prune (clonerepo : Repository ) -> None :
5359 clonerepo .remotes [0 ].fetch (prune = FetchPrune .NO_PRUNE )
5460 assert 'origin/i18n' in clonerepo .branches
5561
5662
57- def test_remote_prune (clonerepo ) :
63+ def test_remote_prune (clonerepo : Repository ) -> None :
5864 pruned = []
5965
6066 class MyCallbacks (pygit2 .RemoteCallbacks ):
61- def update_tips (self , name , old , new ) :
67+ def update_tips (self , name : str , old : Oid , new : Oid ) -> None :
6268 pruned .append (name )
6369
6470 callbacks = MyCallbacks ()
0 commit comments