Skip to content

Commit 4cb4c03

Browse files
tests/u: test_subprocpool.py::test_run_command_writes_to_err
* Attempt to fix flaky test. * Cut out shell profile files to omit some spurious stderr.
1 parent 8221f08 commit 4cb4c03

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/unit/test_subprocpool.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
from pathlib import Path
18+
from types import SimpleNamespace
1719
from tempfile import (
1820
NamedTemporaryFile,
1921
SpooledTemporaryFile,
2022
TemporaryFile,
2123
TemporaryDirectory,
2224
)
23-
import pytest
2425

25-
from pathlib import Path
26-
from types import SimpleNamespace
26+
import pytest
2727

2828
from cylc.flow import LOG
2929
from cylc.flow.id import Tokens
@@ -79,9 +79,12 @@ def test_run_command_writes_to_out():
7979

8080
def test_run_command_writes_to_err():
8181
"""Test basic usage, command writes to STDERR"""
82-
ctx = SubProcContext('parrot2', ['bash', '-c', 'echo pirate errrr >&2'])
82+
ctx = SubProcContext(
83+
'parrot2',
84+
['bash', '--noprofile', '--norc', '-c', 'echo pirate errrr >&2']
85+
)
8386
SubProcPool.run_command(ctx)
84-
assert ctx.err == 'pirate errrr\n'
87+
assert 'pirate errrr\n'
8588
assert ctx.out == ''
8689
assert ctx.ret_code == 0
8790

0 commit comments

Comments
 (0)