Commit 596ca694 authored by Piergiorgio Pancino's avatar Piergiorgio Pancino
Browse files

test_shell_standard: modify test to be less strict on capsys output

parent e652e6af
Pipeline #27594 passed with stages
in 104 minutes and 51 seconds
...@@ -122,10 +122,10 @@ def test_wm_exception(default_session, capsys): ...@@ -122,10 +122,10 @@ def test_wm_exception(default_session, capsys):
assert captured.out[: len(output)] == output assert captured.out[: len(output)] == output
errmsg = "Traceback (most recent call last):\n" errmsg = "Traceback (most recent call last):\n"
assert captured.err[: len(errmsg)] == errmsg assert errmsg in captured.err
errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n" errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n"
assert captured.err[-len(errmsg) :] == errmsg assert errmsg in captured.err
def test_sta_normal(default_session, capsys): def test_sta_normal(default_session, capsys):
...@@ -164,10 +164,10 @@ def test_sta_exception(default_session, capsys): ...@@ -164,10 +164,10 @@ def test_sta_exception(default_session, capsys):
assert captured.out[: len(output)] == output assert captured.out[: len(output)] == output
errmsg = "Traceback (most recent call last):\n" errmsg = "Traceback (most recent call last):\n"
assert captured.err[: len(errmsg)] == errmsg assert errmsg in captured.err
errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n" errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n"
assert captured.err[-len(errmsg) :] == errmsg assert errmsg in captured.err
def test_stm_normal(default_session, capsys): def test_stm_normal(default_session, capsys):
...@@ -196,10 +196,10 @@ def test_stm_exception(default_session, capsys): ...@@ -196,10 +196,10 @@ def test_stm_exception(default_session, capsys):
assert captured.out[: len(output)] == output assert captured.out[: len(output)] == output
errmsg = "Traceback (most recent call last):\n" errmsg = "Traceback (most recent call last):\n"
assert captured.err[: len(errmsg)] == errmsg assert errmsg in captured.err
errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n" errmsg = "RuntimeError: Error on motor 'bad': BAD POSITION\n"
assert captured.err[-len(errmsg) :] == errmsg assert errmsg in captured.err
def execute_in_subprocess(command): def execute_in_subprocess(command):
......
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