34
34
from git .util import join_path_native
35
35
from git .exc import BadObject
36
36
from gitdb .util import bin_to_hex
37
- from git .compat import string_types
37
+ from git .compat import (
38
+ string_types ,
39
+ # PY3
40
+ )
38
41
from gitdb .test .lib import with_rw_directory
39
42
40
43
import os
@@ -555,7 +558,7 @@ def test_rev_parse(self):
555
558
# start from reference
556
559
num_resolved = 0
557
560
558
- for ref in Reference .iter_items (self .rorepo ):
561
+ for ref_no , ref in enumerate ( Reference .iter_items (self .rorepo ) ):
559
562
path_tokens = ref .path .split ("/" )
560
563
for pt in range (len (path_tokens )):
561
564
path_section = '/' .join (path_tokens [- (pt + 1 ):])
@@ -569,6 +572,8 @@ def test_rev_parse(self):
569
572
pass
570
573
# END exception handling
571
574
# END for each token
575
+ if ref_no == 3 - 1 :
576
+ break
572
577
# END for each reference
573
578
assert num_resolved
574
579
@@ -610,6 +615,7 @@ def test_rev_parse(self):
610
615
# END handle multiple tokens
611
616
612
617
# try partial parsing
618
+ # if not (PY3 and 'TRAVIS' in os.environ):
613
619
max_items = 40
614
620
for i , binsha in enumerate (self .rorepo .odb .sha_iter ()):
615
621
assert rev_parse (bin_to_hex (binsha )[:8 - (i % 2 )].decode ('ascii' )).binsha == binsha
@@ -618,6 +624,7 @@ def test_rev_parse(self):
618
624
# which requires accessing packs, it has some additional overhead
619
625
break
620
626
# END for each binsha in repo
627
+ # end travis special handling
621
628
622
629
# missing closing brace commit^{tree
623
630
self .failUnlessRaises (ValueError , rev_parse , '0.1.4^{tree' )
0 commit comments