Commit df9d69ea authored by Piergiorgio Pancino's avatar Piergiorgio Pancino
Browse files

silx_view: add test to check stdout of process

parent 0747a8ba
......@@ -804,13 +804,18 @@ def newdataset(dataset_name=None):
def silx_view(scan: typing.Union[scans.Scan, None] = None):
"""Open silx view on a given scan (default last scan)"""
args = f"{sys.executable} -m".split()
filename = None
if scan is None:
scan = current_session.scans[-1]
filename = scan._scan_info["filename"]
except IndexError:
def _launch_silx(filename: typing.Union[str, None] = None):
args = f"{sys.executable} -m".split()
if filename:
return subprocess.Popen(args)
import logging
import subprocess
import time
import pytest
from import wa, wm, sta, stm, umvr, lprint, sync
from import wa, wm, sta, stm, _launch_silx
......@@ -230,3 +231,11 @@ def test_sync_lib_mode(capsys, default_session):
assert returncode == 0
assert len(err) == 0
def test_open_silx(xvfb):
# checking if the process opens without stdout errors
process = _launch_silx()
assert process.returncode is None
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment