When running our tests with "make check", they are run through nose, and they are typically run with flag --with-xunit. There seems to be a bug in nose, where if the test output is redirected to another directory (by setting $OUTPUTDIR), the stderr object used in tests acts weird. We use $OUTPUTDIR when running tests in our build environment, but it is typically not set on other machines. This issue was discovered when testing code that used "sys.stderr.fileno()". When running the tests, the tests passed fine on my machine ($OUTPUTDIR not set), but they failed in the build environment. Unless stderr is mocked specifically, the stderr object is treated differently when redirected. This was the error seen in my case: > os.dup2(null, sys.stderr.fileno()) > AttributeError: 'Tee' object has no attribute 'fileno'
I tried finding existing issues on this topic, but I didn't find anything that seemed relevant. Below are the commands I used to trigger the issue on my machine: > mkdir temp_folder > export OPTPUTDIR=$(pwd)/temp_folder > make check