nteract / testbook

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

Replace JSON serialization with cloudpickle and make reference semantics explicit. #153

Open tbenthompson opened 1 year ago

tbenthompson commented 1 year ago

See https://github.com/nteract/testbook/issues/138 for older discussion.

Copied from the changelog:

I think this is a substantial improvement because:

  1. this PR allows serializing a much wider range of objects
  2. makes the API substantially clearer about when a reference will or will not be returned.

I understand that this is a mildly breaking change and adds a dependency and that must be weighed against the benefits. I would argue that the change is very worthwhile!

In my case, I wanted to be able to extract pandas DataFrames and various custom objects from a notebook under test.

codecov-commenter commented 1 year ago

Codecov Report

Merging #153 (0b65427) into main (62d7bd9) will increase coverage by 6.93%. The diff coverage is 88.23%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #153 +/- ## ========================================== + Coverage 91.13% 98.07% +6.93% ========================================== Files 7 8 +1 Lines 361 363 +2 ========================================== + Hits 329 356 +27 + Misses 32 7 -25 ```