Skip to content

Commit 1c070e1

Browse files
committed
Update the test to work with local code rather than with the latest bedrock-ge version on PyPI
1 parent d1b1f8e commit 1c070e1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_examples/test_hk_kaitak_ags3_to_brgi_geodb.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import shutil
33
import sqlite3
44
import subprocess
5+
import sys
56
from pathlib import Path
67
from tempfile import TemporaryDirectory
78

@@ -39,13 +40,16 @@ def test_kaitak_ags3_notebook_runs_and_creates_gpkg(examples_dir):
3940
# TODO: implement logging
4041
# NOTE: The env (environment variables) and encoding are required for running
4142
# the notebook as a script from both Windows and Linux. Without => UnicodeDecodeError
42-
# NOTE: `uvx uv run` runs the marimo notebook as a script in a temporary environment,
43+
# NOTE: `(uvx) uv run` runs the marimo notebook as a script in a temporary environment,
4344
# with the Python version and dependencies specified in the PEP 723 inline script metadata.
45+
# The issue with this approach is that it uses the latest version of bedrock-ge,
46+
# rather than the current code in this repo.
4447
env = os.environ.copy()
4548
env["PYTHONIOENCODING"] = "utf-8"
4649
result = subprocess.run(
4750
# ["uvx", "uv", "run", "--no-project", "--no-cache", str(notebook_path)],
48-
["uv", "run", str(notebook_path)],
51+
# ["uv", "run", str(notebook_path)],
52+
[sys.executable, str(notebook_path)],
4953
check=False,
5054
capture_output=True,
5155
text=True,
@@ -55,7 +59,7 @@ def test_kaitak_ags3_notebook_runs_and_creates_gpkg(examples_dir):
5559

5660
# Check that the script ran successfully
5761
assert result.returncode == 0, (
58-
f"📛 Running `uvx run marimo notebook.py` failed with code {result.returncode}\n"
62+
f"📛 Running `python notebook.py` failed with code {result.returncode}\n"
5963
f"📄 STDOUT:\n{result.stdout}\n"
6064
f"⚠️ STDERR:\n{result.stderr}"
6165
)

0 commit comments

Comments
 (0)