I recently had to update a test that uses pytest-notebook to validate a table produced by notebook code because pandas 2.0.2 added a slight change to the white-space it produces in jupyter notebook:
While looking into this issue, i noticed that the jupyter notebook includes both a plain-text and an html representation of the cell output:
This made me curious -- would it be possible to modify pytest-notebook to load the text/html contents using an xml parser like beautifulsoup and compare them symantically? It seems like it might be a way to avoid false-positives when the 'text/plain' contents change in a way that is not significant, such as changing the column spacing or white-space characters.
I recently had to update a test that uses
pytest-notebook
to validate a table produced by notebook code becausepandas 2.0.2
added a slight change to the white-space it produces in jupyter notebook:While looking into this issue, i noticed that the jupyter notebook includes both a plain-text and an html representation of the cell output:
This made me curious -- would it be possible to modify
pytest-notebook
to load the text/html contents using an xml parser likebeautifulsoup
and compare them symantically? It seems like it might be a way to avoid false-positives when the 'text/plain' contents change in a way that is not significant, such as changing the column spacing or white-space characters.