File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,8 @@ def format_reinstall_output(out: str) -> List[str]:
347
347
# file is present.
348
348
# Skip this line as nothing will happen to this dir.
349
349
continue
350
- match = re .match (r'^(.{11}) (send|del\.) (.*)$' , line )
350
+ match = re .match (r'^(.{11}) (send|del\.|recv) (.*)$' , line )
351
+ # (On some systems, may get "recv" instead of "send")
351
352
if match :
352
353
summary , operation , file = match .groups ()
353
354
color = 'green' if operation == 'send' else 'red'
Original file line number Diff line number Diff line change 19
19
import asyncio
20
20
from contextlib import asynccontextmanager
21
21
from pathlib import Path
22
+ import re
22
23
from secrets import token_hex
23
24
from types import SimpleNamespace
24
25
26
+ from ansimarkup import strip as cstrip
25
27
import pytest
26
28
27
29
from cylc .flow .exceptions import WorkflowFilesError
45
47
# workflow_running: yes no
46
48
47
49
50
+ @pytest .fixture (autouse = True )
51
+ def color_strip (monkeypatch : pytest .MonkeyPatch ):
52
+ """Strip colour as the normal colour stripping doesn't apply to tests."""
53
+ monkeypatch .setattr ('cylc.flow.scripts.reinstall.cparse' , cstrip )
54
+
55
+
48
56
@pytest .fixture
49
57
def interactive (monkeypatch ):
50
58
monkeypatch .setattr (
@@ -312,7 +320,6 @@ async def test_permissions_change(
312
320
one_run ,
313
321
interactive ,
314
322
answer_prompt ,
315
- monkeypatch : pytest .MonkeyPatch ,
316
323
capsys : pytest .CaptureFixture ,
317
324
):
318
325
"""It detects permissions changes."""
@@ -333,7 +340,8 @@ async def test_permissions_change(
333
340
opts = ReInstallOptions (), workflow_id = one_run .id
334
341
)
335
342
out , _ = capsys .readouterr ()
336
- assert "send myscript" in out
343
+ # On some systems may get "recv" instead of "send"
344
+ assert re .search (r'(send|recv) myscript\n' , out )
337
345
338
346
339
347
@pytest .fixture
You can’t perform that action at this time.
0 commit comments