def test_tilde(data):
 session = PipSession()
 with patch('pip.index.os.path.exists', return_value=True):
  finder = PackageFinder(['~/python-pkgs'], [], session=session)
 req = InstallRequirement.from_line('gmpy')
 with pytest.raises(DistributionNotFound):
  finder.find_requirement(req, False)

def test_tilde ( data ) : session = PipSession ( ) with patch ( 'pip.index.os.path.exists' , return_value = True ) : finder = PackageFinder ( [ '~/python-pkgs' ] , [ ] , session = session ) req = InstallRequirement . from_line ( 'gmpy' ) with pytest . raises ( DistributionNotFound ) : finder . find_requirement ( req , False )
finder can accept a path with ~ in it and will normalize it .