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
nbconvert: Transformer tests #3914
Conversation
@@ -79,7 +80,7 @@ def transform_cell(self, cell, resources, cell_index): | |||
else: | |||
data = data.encode("UTF-8") | |||
|
|||
#Build a figure name | |||
#Build a output name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/a/an
@minrk , second pass? |
This contains a couple fixes for the existing transformers, should I open a separate PR targeting 1.0 to merge those fixes? |
bump 🚗 |
Looks good to me. we have a few month to refine. |
"""Build an empty resources dictionary.""" | ||
|
||
res = ResourcesDict() | ||
res['metadata'] = ResourcesDict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does metadata need to be a ResourceDict ? Or should we also test the fact that when it not a resource dict thing works ? (you probably know nbconvert more than me now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just so we can do conversions if something doesn't exist (like notebook name). Otherwise Jinja will crash when parsing if exporting without a notebook name.
After carefull re-reading I have some concern of the use of ResourceDict as then test might actually be testing that attributes are (read or written) as we want to test that they are (written) |
def build_notebook(self): | ||
"""Build a notebook in memory for use with transformer tests""" | ||
|
||
outputs = [nbformat.new_output(output_type="stream", stream="stdout", output_text="a"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also use IPython.nbformat.v3.tests.nbexamples
for an example notebook
nbconvert: Transformer tests
nbconvert: Backport fixes cherry-picked from ipython#3914 and ipython#3923, which include tests that will not be merged into 1.0.
nbconvert: Transformer tests
[not for 1.0]
Adds tests for transformers.