File tree Expand file tree Collapse file tree 1 file changed +27
-5
lines changed Expand file tree Collapse file tree 1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,22 @@ def _spawn(cmd):
73
73
return _spawn
74
74
75
75
76
+ def assert_before (
77
+ child ,
78
+ patts : list [str ],
79
+
80
+ ) -> None :
81
+
82
+ before = str (child .before .decode ())
83
+
84
+ for patt in patts :
85
+ try :
86
+ assert patt in before
87
+ except AssertionError :
88
+ print (before )
89
+ raise
90
+
91
+
76
92
@pytest .fixture (
77
93
params = [False , True ],
78
94
ids = 'ctl-c={}' .format ,
@@ -163,6 +179,8 @@ def do_ctlc(
163
179
time .sleep (delay )
164
180
child .sendcontrol ('c' )
165
181
182
+ before = str (child .before .decode ())
183
+
166
184
# TODO: figure out why this makes CI fail..
167
185
# if you run this test manually it works just fine..
168
186
from conftest import _ci_env
@@ -175,8 +193,6 @@ def do_ctlc(
175
193
# should see the last line on console
176
194
assert patt in before
177
195
178
- before = str (child .before .decode ())
179
-
180
196
181
197
def test_root_actor_bp_forever (
182
198
spawn ,
@@ -365,9 +381,15 @@ def test_multi_subactors(
365
381
366
382
# 2nd name_error failure
367
383
child .expect (r"\(Pdb\+\+\)" )
368
- before = str (child .before .decode ())
369
- assert "Attaching to pdb in crashed actor: ('name_error_1'" in before
370
- assert "NameError" in before
384
+
385
+ assert_before (child , [
386
+ "Attaching to pdb in crashed actor: ('name_error_1'" ,
387
+ "NameError" ,
388
+ ])
389
+
390
+ # before = str(child.before.decode())
391
+ # assert "Attaching to pdb in crashed actor: ('name_error_1'" in before
392
+ # assert "NameError" in before
371
393
372
394
if ctlc :
373
395
do_ctlc (child )
You can’t perform that action at this time.
0 commit comments