Skip to content

Conversation

lucyleeow
Copy link
Contributor

@lucyleeow lucyleeow commented Aug 9, 2019

Closes #528

Prevents output box if captured_std.isspace().
Test to ensure execute_code_block does not generate a code block for print(__doc__).

(also tested locally on plot_kernal_pca.py and does not produce the output box)

@larsoner larsoner added the bug label Aug 9, 2019
@larsoner larsoner merged commit bb7c1ad into sphinx-gallery:master Aug 9, 2019
@larsoner
Copy link
Contributor

larsoner commented Aug 9, 2019

Thanks @lucyleeow

@lesteve
Copy link
Member

lesteve commented Aug 9, 2019

Nice!

output = sg.execute_code_block(
compiler, code_block, example_globals, script_vars, gallery_conf
)
assert output.isspace() == True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comment: you don't need the == True here.

Copy link
Contributor Author

@lucyleeow lucyleeow Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I realised this later - but excused myself as 'making it easier to read'? (:/) Too late now I guess?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit directly in master so we can sleep better at night ;-).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@GaelVaroquaux
Copy link
Contributor

Good job @lucyleeow !

You're starting to own this project :).

Next level: review PRs. You can for instance start with #523

@lucyleeow
Copy link
Contributor Author

:-o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Small regression in 0.4.1: print(__doc__) creates empty output block
4 participants