Capture text output

This commit is contained in:
Jordan Bradford
2025-03-07 16:41:09 -05:00
parent 8cb42a9fc1
commit a099bf647d

View File

@@ -9,9 +9,12 @@ def test_serverextensions():
# jupyter-serverextension writes to stdout and stderr weirdly # jupyter-serverextension writes to stdout and stderr weirdly
proc = subprocess.run( proc = subprocess.run(
["/opt/tljh/user/bin/jupyter-server", "extension", "list", "--sys-prefix"], ["/opt/tljh/user/bin/jupyter-server", "extension", "list", "--sys-prefix"],
stderr=subprocess.PIPE, capture_output=True,
text=True,
) )
output = proc.stdout + proc.stderr
extensions = [ extensions = [
"jupyterlab", "jupyterlab",
"nbgitpuller", "nbgitpuller",
@@ -19,7 +22,7 @@ def test_serverextensions():
] ]
for e in extensions: for e in extensions:
assert e in proc.stderr.decode() assert e in output, f"'{e}' not found in server extensions: {output}"
def test_labextensions(): def test_labextensions():