#!/usr/bin/python3

# autopkgtest check: Run the upstream tox tests using tox itself.  We control
# the test environment though, since the list of upstream supported Python
# versions may not match the list of installed Python versions.

from subprocess import check_output

py2versions = check_output(['pyversions', '-iv']).splitlines()
py3versions = check_output(['py3versions', '-iv']).splitlines()

pyenvs = [
    'py' + version.decode('us-ascii').replace('.', '')
    for version in py2versions + py3versions
    ]

command = ['tox', '-e']
command.extend(pyenvs)

check_output(command)
