Skip to content

Conan 2 arbitrary command output stream capture interfering with message passing #332

@markfinal

Description

@markfinal

In the arbitrary command testing in Conan 2, I cannot see the stderr output from Conan.

This is because of the patching in _patch_conan_output_initialiser

    from conan.api.output import ConanOutput

    conanoutput_old_init = ConanOutput.__init__

    def new_init(self: ConanOutput, scope: str = "") -> None:
        conanoutput_old_init(self, scope)
        self.stream = QueuedStreamSix(queue, Stdout)

    ConanOutput.__init__ = new_init

The code in src/cruizlib/workers/api/v2/arbitrary.py replaces the standard streams

        temp_out = StringIO()
        temp_err = StringIO()
        sys.stdout = temp_out
        sys.stderr = temp_err

but then the _patch_conan_output_initialiser replaces it again. So we never get to see it.

The long and short of this is that the tests cannot check expected message outputs in failure cases.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions