nteract / testbook

🧪 📗 Unit test your Jupyter Notebooks the right way
https://testbook.readthedocs.io
BSD 3-Clause "New" or "Revised" License
420 stars 37 forks source link

Consider text/plain when calling notebook.cell_output_text(idx) #104

Closed nastra closed 3 years ago

nastra commented 3 years ago

We have a use case where the cell output is some Pandas output and when calling notebook.cell_output_text(..) we only get empty output, even though output["data"]["text/plain"] contains actually the expected text.

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

nastra commented 3 years ago

@MSeal sure thing. I added a small example with a test that shows the problem

nastra commented 3 years ago

@MSeal can you take another look at the proposed changes when you get a chance?

MSeal commented 3 years ago

Thanks @nastra -- I'll look at shipping a patch release with the change so it's readily available.

codecov-commenter commented 3 years ago

Codecov Report

Merging #104 (523bc14) into main (5a7aa1e) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   91.13%   91.18%   +0.04%     
==========================================
  Files           8        8              
  Lines         361      363       +2     
==========================================
+ Hits          329      331       +2     
  Misses         32       32