From f03f9a1a0fbb25758cdb60bff8584a35248d9b5b Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Sat, 19 Oct 2024 12:03:50 +0200 Subject: [PATCH] try normpath again with some debug statements --- .github/workflows/checks.yml | 2 +- test_notebooks.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index b1b31f4..7be39a2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -50,5 +50,5 @@ jobs: - run: pip install -r requirements.txt - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pytest -vv -We . + run: pytest -vv -rP -We . diff --git a/test_notebooks.py b/test_notebooks.py index 6a341d7..638308a 100644 --- a/test_notebooks.py +++ b/test_notebooks.py @@ -28,7 +28,10 @@ def _relative_path(absolute_path): - return os.path.relpath(absolute_path, _repo_path().absolute()) + relpath = os.path.relpath(absolute_path, _repo_path().absolute()) + normpath = os.path.normpath(relpath) + print(f"{relpath=}, {normpath=}") + return normpath def _repo_path(): @@ -50,7 +53,7 @@ def _repo_path(): name="notebook_filename", ) def _notebook_filename(request): - return os.path.normpath(request.param) + return request.param def test_run_notebooks(notebook_filename, tmp_path): @@ -135,7 +138,7 @@ def _colab_badge_markdown(absolute_path): def test_first_cell_contains_three_badges(notebook_filename): - """checks if all notebooks feature nbviewer, mybinder and Colab badges + """checks if all notebooks feature Github preview, mybinder and Colab badges (in the first cell)""" with open(notebook_filename, encoding="utf8") as fp: nb = nbformat.read(fp, nbformat.NO_CONVERT)