mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Capture text output
This commit is contained in:
@@ -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():
|
||||||
|
|||||||
Reference in New Issue
Block a user