def test_finder_only_installs_data_require(data):
 finder = PackageFinder([], [data.index_url('datarequire')], session=PipSession())
 links = finder.find_all_candidates('fakepackage')
 expected = ['1.0.0', '9.9.9']
 if (sys.version_info < (2, 7)):
  expected.append('2.6.0')
 elif ((2, 7) < sys.version_info < (3,)):
  expected.append('2.7.0')
 elif (sys.version_info > (3, 3)):
  expected.append('3.3.0')
 assert (set([str(v.version) for v in links]) == set(expected))

def test_finder_only_installs_data_require ( data ) : finder = PackageFinder ( [ ] , [ data . index_url ( 'datarequire' ) ] , session = PipSession ( ) ) links = finder . find_all_candidates ( 'fakepackage' ) expected = [ '1.0.0' , '9.9.9' ] if ( sys . version_info < ( 2 , 7 ) ) : expected . append ( '2.6.0' ) elif ( ( 2 , 7 ) < sys . version_info < ( 3 , ) ) : expected . append ( '2.7.0' ) elif ( sys . version_info > ( 3 , 3 ) ) : expected . append ( '3.3.0' ) assert ( set ( [ str ( v . version ) for v in links ] ) == set ( expected ) )
test whether the packagefinder understand data-python-requires this can optionally be exposed by a simple-repository to tell which distribution are compatible with which version of python by adding a data-python-require to the anchor links .