You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Pipes does not require Python 2 to operate. It should not require it for tests, but at present the tests do not pass unless it is installed.
To Reproduce
Make sure there is no system python2 executable available
Run pytest
Expected behavior
The tests should pass
Actual behaviour
Tests fail with an error like the following:
___________ ERROR at setup of TestFindEnvironments.test_find_binary ____________
request = <FixtureRequest for <Function 'test_find_binary'>>
def fill(request):
item = request._pyfuncitem
fixturenames = item.fixturenames
autousenames = item.session._fixturemanager._getautousenames(item.nodeid)
for fname in fixturenames:
if fname not in item.funcargs and fname in autousenames:
item.funcargs[fname] = request.getfixturevalue(fname)
if hasattr(item, 'callspec'):
for param, val in sorted_by_dependency(item.callspec.params, fixturenames):
if is_lazy_fixture(val):
item.callspec.params[param] = request.getfixturevalue(val.name)
> _fillfixtures()
/usr/lib/python3/dist-packages/pytest_lazyfixture.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:129: in mock_env_home
envs = find_environments(pipenv_home)
pipenv_pipes/core.py:33: in find_environments
binpath = find_binary(envpath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
envpath = '/tmp/pipenv_home_real0cjax3c0/proj1-7PMzaxDr'
def find_binary(envpath):
""" Finds the python binary in a given environment path """
env_ls = os.listdir(envpath)
if 'bin' in env_ls:
binpath = os.path.join(envpath, 'bin', 'python')
elif 'Scripts' in env_ls:
binpath = os.path.join(envpath, 'Scripts', 'python.exe')
else:
raise EnvironmentError(
> 'could not find python binary path: {}'.format(envpath))
E OSError: could not find python binary path: /tmp/pipenv_home_real0cjax3c0/proj1-7PMzaxDr
pipenv_pipes/core.py:52: OSError
________ ERROR at setup of TestFindEnvironments.test_get_python_version ________
request = <FixtureRequest for <Function 'test_get_python_version'>>
def fill(request):
item = request._pyfuncitem
fixturenames = item.fixturenames
autousenames = item.session._fixturemanager._getautousenames(item.nodeid)
for fname in fixturenames:
if fname not in item.funcargs and fname in autousenames:
item.funcargs[fname] = request.getfixturevalue(fname)
if hasattr(item, 'callspec'):
for param, val in sorted_by_dependency(item.callspec.params, fixturenames):
if is_lazy_fixture(val):
item.callspec.params[param] = request.getfixturevalue(val.name)
> _fillfixtures()
/usr/lib/python3/dist-packages/pytest_lazyfixture.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:129: in mock_env_home
envs = find_environments(pipenv_home)
pipenv_pipes/core.py:33: in find_environments
binpath = find_binary(envpath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
envpath = '/tmp/pipenv_home_realeeyf2spo/proj1-AJFfG1vO'
def find_binary(envpath):
""" Finds the python binary in a given environment path """
env_ls = os.listdir(envpath)
if 'bin' in env_ls:
binpath = os.path.join(envpath, 'bin', 'python')
elif 'Scripts' in env_ls:
binpath = os.path.join(envpath, 'Scripts', 'python.exe')
else:
raise EnvironmentError(
> 'could not find python binary path: {}'.format(envpath))
E OSError: could not find python binary path: /tmp/pipenv_home_realeeyf2spo/proj1-AJFfG1vO
pipenv_pipes/core.py:52: OSError
After a bit of digging, I managed to trace the problem to the virtualenv creation. The virtualenv command is failing, but because it outputs to stdout the error is being ignored (aside: it would be a good idea to check the error code here instead of just stderr). Then conftest tries to continue without a virtualenv, leading to the error pasted above.
Environment:
OS: Debian sid
The text was updated successfully, but these errors were encountered:
Describe the bug
Pipes does not require Python 2 to operate. It should not require it for tests, but at present the tests do not pass unless it is installed.
To Reproduce
python2
executable availablepytest
Expected behavior
The tests should pass
Actual behaviour
Tests fail with an error like the following:
After a bit of digging, I managed to trace the problem to the virtualenv creation. The virtualenv command is failing, but because it outputs to stdout the error is being ignored (aside: it would be a good idea to check the error code here instead of just stderr). Then conftest tries to continue without a virtualenv, leading to the error pasted above.
Environment:
The text was updated successfully, but these errors were encountered: