Skip to content

Commit ece6b7b

Browse files
committed
test: enable pexpect stdout logging by default only in CI
1 parent 75ca6fa commit ece6b7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/t/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def bash(request) -> pexpect.spawn:
177177
logfile = None
178178
if os.environ.get("BASHCOMP_TEST_LOGFILE"):
179179
logfile = open(os.environ["BASHCOMP_TEST_LOGFILE"], "w")
180+
elif os.environ.get("CI"):
181+
logfile = sys.stdout
180182
testdir = os.path.abspath(
181183
os.path.join(os.path.dirname(__file__), os.pardir)
182184
)
@@ -199,7 +201,7 @@ def bash(request) -> pexpect.spawn:
199201
bash = pexpect.spawn(
200202
"%s --norc" % os.environ.get("BASHCOMP_TEST_BASH", "bash"),
201203
maxread=os.environ.get("BASHCOMP_TEST_PEXPECT_MAXREAD", 20000),
202-
logfile=logfile or sys.stdout,
204+
logfile=logfile,
203205
cwd=fixturesdir,
204206
env=env,
205207
encoding="utf-8", # TODO? or native or...?

0 commit comments

Comments
 (0)