I am currently working on a project that includes tests that will run on a remote host (bash). Unfortunately, the remote python interpreter does not respect the available site packages (it is built-in: abaqus python (2.6)). However, using the PYTHONPATH variable allows you to specify local settings and make additional packages available. Therefore, on the remote computer, I simply add the appropriate line to my .bashrc file.
Unfortunately, when distributing tests using xdist, only bare bash is called, without any specific rcs profiles. Thus, the tests fail with some import errors, since the argparse, which pytest requires, is not available.
Is there a way to configure the remote host before it starts executing any pytest code (which requires argparse)? In other words, is there a way to add environment variables on nodes before starting pytest import?
I tried using appliances with session area and autouse=True , which (of course) did not work. Also, I tried something like
It looks like it is running on the remote host, but sys.path remains the host, and the argparse module still cannot be imported.
I run tests using
py.test --tx ssh=user@server //python="abaqus613 python" -vs --dist=each --rsyncdir foo
This starts the correct python interpreter (Python 2.6.2 for Abaqus 6.13-2), but with an error
ImportError: No module named argparse
Jakob
source share