Skip to content

Fails or pass depending on capture mode! #2955

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

Closed
olivierverdier opened this issue Nov 27, 2017 · 1 comment
Closed

Fails or pass depending on capture mode! #2955

olivierverdier opened this issue Nov 27, 2017 · 1 comment

Comments

@olivierverdier
Copy link

I have a test which involves calling an external function (compiled from swig).
The test looks like

def test():
    data = preparedata()
    call_my_external_function(data)
    assert False

The problems is that pytest --capture=X fails or passes depending on X.

  • fd : passes
  • no: fails
  • sys: fails

I expected a failure in all cases.

Version of pytest: 3.2.5, on Ubuntu.

I can't provide you with a minimal working example, because the key problem is the call to this function. If I place assert False before the call, then pytest fails no matter what the capturing metho is. So something happens when calling this exterior function.

How can I go ahead and debug this further?

@olivierverdier
Copy link
Author

My mistake, I got confused by the output.

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

No branches or pull requests

1 participant