Skip to content

Commit

Permalink
gh pex-tool#68: Make --platform/--interpreter multi-options pass styl…
Browse files Browse the repository at this point in the history
…e tests
  • Loading branch information
mzdaniel committed May 22, 2016
1 parent bfd467d commit 572f7f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pex/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ def resolve_multi(requirements,
resolveds = list()
for platform in platforms:
for interpreter in interpreters:
for r in resolve(requirements, fetchers, interpreter, platform, context, precedence, cache, cache_ttl):
for r in resolve(requirements, fetchers, interpreter, platform, context,
precedence, cache, cache_ttl):
resolveds.append(r)

return resolveds
9 changes: 5 additions & 4 deletions tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

from pex.common import safe_copy
from pex.fetcher import Fetcher
from pex.interpreter import PythonInterpreter
from pex.package import EggPackage, SourcePackage
from pex.resolvable import ResolvableRequirement
from pex.resolver import Unsatisfiable, _ResolvableSet, resolve, resolve_multi
from pex.resolver_options import ResolverOptionsBuilder
from pex.interpreter import PythonInterpreter
from pex.testing import make_sdist


Expand Down Expand Up @@ -47,12 +47,13 @@ def test_simple_local_resolve():
def test_simple_local_resolve_multi():
project_sdist = make_sdist(name='project')
interpreters = [PythonInterpreter.from_env('python2'), PythonInterpreter.from_env('python3')]
platforms = ['linux-x86_64', 'macosx-10.11-x86_64']
platforms = ['linux-x86_64', 'macosx-10.11-x86_64']

with temporary_dir() as td:
safe_copy(project_sdist, os.path.join(td, os.path.basename(project_sdist)))
fetchers = [Fetcher([td])]
dists = resolve_multi(['project'], fetchers=fetchers, interpreters=interpreters, platforms=platforms)
dists = resolve_multi(['project'], fetchers=fetchers,
interpreters=interpreters, platforms=platforms)
assert len(dists) == 4


Expand All @@ -69,7 +70,7 @@ def test_platform_resolve_multi():

def test_interpreters_resolve_multi():
project_sdist = make_sdist(name='project')
platforms = ['linux-x86_64', 'macosx-10.11-x86_64']
platforms = ['linux-x86_64', 'macosx-10.11-x86_64']

with temporary_dir() as td:
safe_copy(project_sdist, os.path.join(td, os.path.basename(project_sdist)))
Expand Down

0 comments on commit 572f7f1

Please sign in to comment.