From 1f1d3d1d6af9e8a19fa5e588f98b57886c7bb72a Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 24 Jan 2024 11:05:50 +0100
Subject: [PATCH] [nb] Follow-up on testrunner ruff fixes.

Will fix tutorial notebook web sites.
---
 Tests/Data/Notebooks/testrunner.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Tests/Data/Notebooks/testrunner.py b/Tests/Data/Notebooks/testrunner.py
index 65cc2a1a797..59fc58f91a9 100644
--- a/Tests/Data/Notebooks/testrunner.py
+++ b/Tests/Data/Notebooks/testrunner.py
@@ -167,13 +167,8 @@ for notebook_file in args.notebooks:
         notebook_basename = (
             notebook_file_path.parent.resolve() / notebook_file_path.stem
         )
-        if "web/content" in str(notebook_basename):
-            notebook_output_path = notebook_basename
-        else:
-            notebook_output_path = (
-                Path(args.out)
-                / Path(notebook_basename).relative_to(os.environ["OGS_DATA_DIR"])
-            ).resolve()
+        _relpath = os.path.relpath(notebook_basename, start=os.environ["OGS_DATA_DIR"])
+        notebook_output_path = (Path(args.out) / _relpath).resolve()
         notebook_output_path.mkdir(parents=True, exist_ok=True)
         os.environ["OGS_TESTRUNNER_OUT_DIR"] = str(notebook_output_path)
         notebook_filename = notebook_file_path.name
-- 
GitLab