Skip to content
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

File as test instead of cell #154

Open
RomeshA opened this issue Aug 12, 2020 · 3 comments
Open

File as test instead of cell #154

RomeshA opened this issue Aug 12, 2020 · 3 comments

Comments

@RomeshA
Copy link

RomeshA commented Aug 12, 2020

Would it be possible to support treating entire files as a single test, rather than individual cells? We have a decent amount of documentation in the form of notebooks that get tested during our CI workflow, but there are on the order of 1000 cells across about 20 notebook files, vs. about 100 actual Python test functions. Since the notebooks are structured as documents, workflows are often split across cells separated by narrative text, so it doesn't make so much sense for us to treat each individual cell as a separate test. We are currently using https://github.com/pyviz-dev/nbsmoke which does treat each file as a single test, but that module is now broken for the same reason as #139 and it looks like that project is recommending to switch to nbval

@RomeshA
Copy link
Author

RomeshA commented Aug 13, 2020

Thanks @alex-treebeard I haven't seen treebeard before and it looks like a useful project! For our use case though, we already have CI setup in Azure Pipelines that handles our other pytest tests, and also documentation generation via Sphinx, and deployment both of the documentation and to PyPI. So my inclination would be to try and integrate into our existing pipeline if possible, whereas treebeard seems to be a more complete solution package if we weren't using pytest and needed to set up a new CI pipeline.

I think this is also related to some of @ceball's thoughts e.g. #141 (comment) regarding the use case 'Does the notebook execute all the way through without exception?' which is in fact exactly our use case

@vidartf
Copy link
Collaborator

vidartf commented Sep 28, 2020

Just so we are on the same page, what is the main motivation for wanting it as a single test? Is it purely a "looks better" case, or are there negative consequences?

@sk1p
Copy link

sk1p commented Jun 7, 2021

are there negative consequences?

One consequence of having one test per cell is that pytest --ff doesn't work properly - it tries to execute the cells out-of-order. Other than that, I like the per-cell version, too.

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

No branches or pull requests

3 participants