@@ -83,7 +83,7 @@ def test_indirect_illegal_within_one_package(
8383 self , specify_container : bool , start : str , end : str , route_middle : list [str ]
8484 ):
8585 graph = self ._build_legal_graph ()
86- import_pairs = _pairwise ([start , * route_middle , end ])
86+ import_pairs = itertools . pairwise ([start , * route_middle , end ])
8787 for importer , imported in import_pairs :
8888 graph .add_import (importer = importer , imported = imported )
8989
@@ -479,7 +479,7 @@ def test_indirect_illegal_within_one_package(
479479 self , specify_container : bool , start : str , end : str , route_middle : list [str ]
480480 ):
481481 graph = self ._build_legal_graph ()
482- import_pairs = _pairwise ([start , * route_middle , end ])
482+ import_pairs = itertools . pairwise ([start , * route_middle , end ])
483483 for importer , imported in import_pairs :
484484 graph .add_import (importer = importer , imported = imported )
485485
@@ -668,7 +668,7 @@ def test_indirect_illegal_across_two_packages(
668668 self , start : str , end : str , route_middle : list [str ]
669669 ):
670670 graph = self ._build_legal_graph ()
671- import_pairs = _pairwise ([start , * route_middle , end ])
671+ import_pairs = itertools . pairwise ([start , * route_middle , end ])
672672 for importer , imported in import_pairs :
673673 graph .add_import (importer = importer , imported = imported )
674674
@@ -949,18 +949,6 @@ def test_missing_layer_is_ignored_with_multiple_containers(self):
949949 }
950950
951951
952- def _pairwise (iterable ):
953- """
954- Return successive overlapping pairs taken from the input iterable.
955- pairwise('ABCDEFG') --> AB BC CD DE EF FG
956-
957- TODO: Replace with itertools.pairwise once on Python 3.10.
958- """
959- a , b = itertools .tee (iterable )
960- next (b , None )
961- return zip (a , b )
962-
963-
964952class TestClosedLayers :
965953 @pytest .mark .parametrize (
966954 "importer, imported, expect_ok" ,
0 commit comments