treebeardtech / nbmake

📝 Pytest plugin for testing notebooks
https://pypi.org/project/nbmake/
Apache License 2.0
179 stars 18 forks source link

Add a --recursive flag? #84

Closed jkbhagatio closed 1 year ago

jkbhagatio commented 1 year ago

The * wildcard search does not work in Windows terminals. For example, pytest --nbmake */*.ipynb finds all ipynbs one level below in a bash terminal, but not in powershell or cmd. Maybe there could be a pytest --nbmake --recursive command that recursively searches all lower levels for ipynbs?

alex-treebeard commented 1 year ago

Hi @jkbhagatio, I would expect you need 2 * e.g. pytest --nbmake **/*.ipynb

Does this not work on windows?

jkbhagatio commented 1 year ago

Nope, on Windows * and ** do not act as path wildcards on their own, instead they have to be used with some other command, like get-childitem https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.2

It seems pytest --nbmake is implicitly calling find on the path argument? I guess the equivalent would be calling get-childitem on the path arg on windows machines? It'd be nice if pytest --nbmake could do recursive searches with the same syntax os-agnostic

alex-treebeard commented 1 year ago

This behaviour is actually determined by pytest.

nbmake really just hooks into the test collection behaviour of pytest.

My gut feeling is that pytest already has the capability you are looking for but you will have to find out how to trigger it as there are lots of options/config.

I'm going to close this issue so you can follow up with pytest but please reopen if you think this is nbmake's fault.