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

print does not show in console #3

Open
jwickens opened this issue Mar 23, 2019 · 3 comments
Open

print does not show in console #3

jwickens opened this issue Mar 23, 2019 · 3 comments

Comments

@jwickens
Copy link

First of all, love this. Way better than pure python alternatives.

One of the surprising things coming from jest for JS is that the calls to print do not show up in the console. Not sure what would be involved with fixing that, but just thought I'd point that out.

Thanks again!

@jondot
Copy link
Collaborator

jondot commented Mar 24, 2019

Very happy you like this. I'm definitely a testing connoisseur so I prefer not to use any of the python tooling.
I believe jest captures the output and prints/not-prints it per your configuration, but oddly enough - I haven't missed that or noticed anything special in my workflow.

@jwickens
Copy link
Author

I see the test result output but I don't see for example these print statements:

print('hi -------------------------------------------------')
def test_thing():
    print('hi ------------------------------------------------')
    x = thing()

I also tried setting JEST_PYTEST_DEBUG_IPC to True, and saw a bunch more output but not the print statements.

Maybe the result of these execa call ({stdout, stderr}) could be console.log'd ?

await execa('py.test', ['-vv', '--snapshot-update'])

const res = await execa('py.test', [

@jwickens
Copy link
Author

So when I do that I see the print statements now like so:

----------------------------- Captured stdout call -----------------------------
hi ------------------------------------------------
hi ------------------------------------------------
hi ------------------------------------------------
hi ------------------------------------------------

along with all the output jest-pytest is already showing. I guess it would have to be grepped out and then passed into jest-result. Also maybe we can get the captured stdout from pytest from the file where you already get the main 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

2 participants