You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't been able to resolve it. The one package that I know can do something like that is jupytext. I hope I can make a PR for windows later if I got the time.
I see. I don't think we can expect this to work on windows as documented, the best course of action for this case may be:
Either we solve this by fixing the glob expression -- powershell may have a different way of doing this to bash (blog)
We rely on pytest's features for specifying/selecting tests (docs). In this case you would pass the whole directory to pytest e.g. pytest --nbmake . and add arguments for selecting your notebooks.
Are you able to find a way to do this natively with powershell?
But, if there is a .py files in notebooks/ dir, it will also be tested by pytest. I haven't know how to make all .py on tests/ and .ipynb in notebooks/.
But, as far as I understand, pytest --nbmake -n=auto **/*ipynb means that **/*ipynb belongs to nbmake parameters (not pytest parameters)? If yes, implementing glob inside nbmake and pass that to pytest should be possible? #CMIIW
Note that I already separate my tests to testpaths: tests (for py files), notebooks (for ipynb files, no longer any py files)
This issue can be closed actually because config solve it. But, this issue could tell other users when they are using this package at the first time and see that bare pytest --nbmake -n=auto **/*ipynb could not find any files, come here, understand that they need at least include config for windows user.
Activity
alex-remedios commentedon Feb 12, 2023
hi @yasirroni , sorry I am late responding to this.
I don't have a windows device and generally restrict testing to Linux. Were you able to resolve this problem? If so, please share how.
yasirroni commentedon Feb 12, 2023
I haven't been able to resolve it. The one package that I know can do something like that is
jupytext. I hope I can make a PR for windows later if I got the time.alex-remedios commentedon Feb 13, 2023
I see. I don't think we can expect this to work on windows as documented, the best course of action for this case may be:
pytest --nbmake .and add arguments for selecting your notebooks.Are you able to find a way to do this natively with powershell?
yasirroni commentedon Feb 21, 2023
MWE that working:
pytest -c pyproject.toml --nbmakewith
pyproject.tomlfile:But, if there is a
.pyfiles innotebooks/dir, it will also be tested bypytest. I haven't know how to make all.pyontests/and.ipynbinnotebooks/.Don't forget to ignore
checkpoints:yasirroni commentedon Feb 21, 2023
But, as far as I understand,
pytest --nbmake -n=auto **/*ipynbmeans that**/*ipynbbelongs tonbmakeparameters (notpytestparameters)? If yes, implementing glob insidenbmakeand pass that topytestshould be possible? #CMIIWalex-remedios commentedon Feb 21, 2023
When you enter
**/*ipynbinto the shell. It is expanded by the interpreter (on linux this is bash, on windows this is powershell).Pytest and nbmake receive the output of the expanded
**/*ipynb(which isx.ipynb y.ipynb ...)If I'm correct, we shouldn't implement wildcards again in pytest/nbmake because it violates the single responsibility principle.
Are you able to share with me the output from
pytest --nbmake --collect-only?We can use the collected names to form a selector.
yasirroni commentedon Feb 26, 2023
Note that I already separate my tests to testpaths: tests (for py files), notebooks (for ipynb files, no longer any py files)
This issue can be closed actually because config solve it. But, this issue could tell other users when they are using this package at the first time and see that bare
pytest --nbmake -n=auto **/*ipynbcould not find any files, come here, understand that they need at least include config for windows user.