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

Fix passing args to py.test on POSIX systems #18

Merged
merged 1 commit into from
Jun 27, 2015

Conversation

blueyed
Copy link
Collaborator

@blueyed blueyed commented Jun 26, 2015

Use shell=True only for MS Windows when executing py.test.

Ref: aldanor@dc066e212#commitcomment-11887976

Use shell=True only for MS Windows when executing py.test.

Ref: aldanor@dc066e212#commitcomment-11887976
blueyed referenced this pull request in aldanor/pytest-watch Jun 26, 2015
This fixes the edge case when py.test arguments contained quoted strings
with spaces, e.g.:

    ptw -- -m 'not slow'
@@ -88,7 +88,8 @@ def run(self, summary=None):
msg = ('Changes detected, rerunning: {}'
.format(highlight(command)))
print(STYLE_NORMAL + msg + Fore.RESET + Style.NORMAL)
exit_code = subprocess.call(['py.test'] + self.args, shell=True)
exit_code = subprocess.call(['py.test'] + self.args,
shell=subprocess.mswindows)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, never knew about subprocess.mswindows. There's so many ways to test what OS you're on. This one definitely seems the most explicit when doing a Windows-only check.

@joeyespo
Copy link
Owner

Thank you, @blueyed!

joeyespo added a commit that referenced this pull request Jun 27, 2015
Fix passing args to py.test on POSIX systems
@joeyespo joeyespo merged commit 59e381f into joeyespo:master Jun 27, 2015
@blueyed blueyed deleted the shell-true-for-windows branch June 28, 2015 00:06
@joeyespo joeyespo added the bug label Jun 28, 2015
@joeyespo
Copy link
Owner

Just deployed v3.2.0 Let me know if something is still broken for you, @blueyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants