Bug 8462 - Stderr in nose acts weird when run with xunit and $OUTPUTDIR
Summary: Stderr in nose acts weird when run with xunit and $OUTPUTDIR
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-26 16:09 CET by Linn
Modified: 2024-12-03 13:20 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Linn cendio 2024-11-26 16:09:58 CET
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'
Comment 2 Linn cendio 2024-11-26 17:28:28 CET
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

Note You need to log in before you can comment on or make changes to this bug.