Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix capture output when running tests that call the ConanRunner in the conanfile #7799

Merged
merged 2 commits into from Oct 2, 2020

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Oct 2, 2020

Changelog: Fix: Fix capture output when running tests that call the ConanRunner in the conanfile.
Docs: omit

When the ConanRunner was called inside the conanfile the output was not correctly captured depending the case, making imposible to make tests that check the self.run method output. This was because _UnbufferedWrite was encapsulating the ConanOutput and checking if the output had to be captured was returning the wrong results:

capture_output = log_handler or not self._log_run_to_output or (
stream_output and isinstance(stream_output._stream, six.StringIO))
if capture_output:
proc = Popen(command, shell=isinstance(command, six.string_types), stdout=PIPE,
stderr=STDOUT, cwd=cwd)
else:
proc = Popen(command, shell=isinstance(command, six.string_types), cwd=cwd)
(because the stream_output._stream was not an instance of six.StringIO but of TestBufferConanOutput or ConanOutput)

@czoido czoido added this to the 1.30 milestone Oct 2, 2020
@czoido czoido merged commit e000c38 into conan-io:release/1.30 Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants