diff --git a/tests/devx/conftest.py b/tests/devx/conftest.py index efc74d44..b7559706 100644 --- a/tests/devx/conftest.py +++ b/tests/devx/conftest.py @@ -68,7 +68,10 @@ def spawn( ''' import os + # disable colored tbs os.environ['PYTHON_COLORS'] = '0' + # disable all ANSI color output + # os.environ['NO_COLOR'] = '1' spawned: PexpectSpawner|None = None @@ -251,12 +254,13 @@ def assert_before( err_on_false=True, **kwargs ) + return str(child.before.decode()) def do_ctlc( child, count: int = 3, - delay: float = 0.1, + delay: float|None = None, patt: str|None = None, # expect repl UX to reprint the prompt after every @@ -268,6 +272,7 @@ def do_ctlc( ) -> str|None: before: str|None = None + delay = delay or 0.1 # make sure ctl-c sends don't do anything but repeat output for _ in range(count): @@ -278,7 +283,10 @@ def do_ctlc( # if you run this test manually it works just fine.. if expect_prompt: time.sleep(delay) - child.expect(PROMPT) + child.expect( + PROMPT, + # timeout=1, # TODO? if needed + ) before = str(child.before.decode()) time.sleep(delay)