-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Revert back to having a default shell #68448
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
base: 3006.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,26 +23,26 @@ class EnabledTest(ModuleCase): | |
| ) | ||
|
|
||
| @pytest.mark.skip_on_windows(reason="Skip on Windows OS") | ||
| def test_shell_default_disabled(self): | ||
| @pytest.mark.skip_on_freebsd | ||
| def test_shell_default_enabled(self): | ||
| """ | ||
| ensure that python_shell defaults to False for cmd.run | ||
| ensure that python_shell defaults to True for cmd.run | ||
| """ | ||
| disabled_ret = ( | ||
| "first\nsecond\nthird\n|\nwc\n-l\n;\nexport\nSALTY_VARIABLE=saltines" | ||
| "\n&&\necho\n$SALTY_VARIABLE\n;\necho\nduh\n&>\n/dev/null" | ||
| ) | ||
| disabled_ret = "3\nsaltines" # the result of running self.cmd in a shell | ||
| ret = self.run_function("cmd.run", [self.cmd]) | ||
| self.assertEqual(ret, disabled_ret) | ||
|
|
||
| @pytest.mark.skip_on_windows(reason="Skip on Windows OS") | ||
| @pytest.mark.skip_on_freebsd | ||
| def test_shell_enabled(self): | ||
| def test_shell_disabled(self): | ||
|
Comment on lines
35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would good be good to have a test for windows to ensure the expected behavior occurs when |
||
| """ | ||
| test shell enabled output for cmd.run | ||
| test shell disabled output for cmd.run | ||
| """ | ||
| enabled_ret = "3\nsaltines" # the result of running self.cmd in a shell | ||
| ret = self.run_function("cmd.run", [self.cmd], python_shell=True) | ||
| self.assertEqual(ret.strip(), enabled_ret) | ||
|
Comment on lines
-38
to
-45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like it would be good to also have |
||
| disabled_ret = ( | ||
| "first\nsecond\nthird\n|\nwc\n-l\n;\nexport\nSALTY_VARIABLE=saltines" | ||
| "\n&&\necho\n$SALTY_VARIABLE\n;\necho\nduh\n&>\n/dev/null" | ||
| ) | ||
| ret = self.run_function("cmd.run", [self.cmd], python_shell=False) | ||
| self.assertEqual(ret.strip(), disabled_ret) | ||
|
|
||
| @pytest.mark.skip_on_windows(reason="Skip on Windows OS") | ||
| @pytest.mark.skip_on_freebsd | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any tests for cmd_safe? I did a quick search and did not notice any.