Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure test_run.py works when system-wide bashrc produces output #722

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

waveform80
Copy link
Contributor

The --rcfile option to bash does not prevent the system-wide /etc/bash.bashrc script from running (contrary to the Debian man-page). This causes test_run.py to fail when the system-wide script produces output (as is the case in an Ubuntu image where the regular user belongs to the "sudo" group and the system-wide script produces an informational message about sudo usage).

Rather than rely on --rcfile, this patch changes the test to use --norc (which does suppress the execution of the system-wide bashrc), and changes PS1 via the inherited environment instead (this also slightly simplifies the fixture setup too as tempfile is no longer required).

The --rcfile option to bash does not prevent the system-wide
/etc/bash.bashrc script from running (contrary to the Debian man-page).
This causes test_run.py to fail when the system-wide script produces
output (as is the case in an Ubuntu image where the regular user belongs
to the "sudo" group and the system-wide script produces an informational
message about sudo usage).

Rather than rely on --rcfile, this patch changes the test to use --norc
(which does suppress the execution of the system-wide bashrc), and
changes PS1 via the inherited environment instead (this also slightly
simplifies the fixture setup too as tempfile is no longer required).
@Red-M Red-M closed this Feb 14, 2023
@Red-M Red-M reopened this Feb 14, 2023
@Red-M
Copy link
Member

Red-M commented Feb 14, 2023

Apologies, re-opening is the only way to get github to realise it needs to run the test suite.

@Red-M Red-M merged commit afb85a7 into pexpect:master Feb 14, 2023
@waveform80 waveform80 deleted the fix-run-tests branch February 14, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants