diff --git a/bin-for-dist/test_install.py b/bin-for-dist/test_install.py index 2a3d9f1e7..b18bdc0d5 100644 --- a/bin-for-dist/test_install.py +++ b/bin-for-dist/test_install.py @@ -66,7 +66,10 @@ class VirtualEnv(object): return "" %(self.path) def _cmd(self, name): - return os.path.join(self.path, 'bin', name) + if sys.platform == "win32": + return os.path.join(self.path, 'Scripts', name) + else: + return os.path.join(self.path, 'bin', name) def ensure(self): if not os.path.exists(self._cmd('python')): diff --git a/py/impl/process/cmdexec.py b/py/impl/process/cmdexec.py index aa2031f10..5720593e0 100644 --- a/py/impl/process/cmdexec.py +++ b/py/impl/process/cmdexec.py @@ -14,7 +14,9 @@ def cmdexec(cmd): the exception will provide an 'err' attribute containing the error-output from the command. """ - process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + process = subprocess.Popen(cmd, shell=True, + universal_newlines=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = process.communicate() out = py.builtin._totext(out, sys.getdefaultencoding()) err = py.builtin._totext(err, sys.getdefaultencoding()) diff --git a/py/plugin/pytest_terminal.py b/py/plugin/pytest_terminal.py index 0715cf087..3fde31b33 100644 --- a/py/plugin/pytest_terminal.py +++ b/py/plugin/pytest_terminal.py @@ -292,7 +292,7 @@ class TerminalReporter: self.summary_stats() def pytest_keyboard_interrupt(self, excinfo): - self._keyboardinterrupt_memo = excinfo.getrepr() + self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True) def _report_keyboardinterrupt(self): self.write_sep("!", "KEYBOARD INTERRUPT") diff --git a/testing/process/test_cmdexec.py b/testing/process/test_cmdexec.py index c8965ab00..79629d886 100644 --- a/testing/process/test_cmdexec.py +++ b/testing/process/test_cmdexec.py @@ -9,6 +9,11 @@ class Test_exec_cmd: out = cmdexec('echo hallo') assert out.strip() == 'hallo' + def test_simple_newline(self): + import sys + out = cmdexec(r"""%s -c "print ('hello')" """ % sys.executable) + assert out == 'hello\n' + def test_simple_error(self): py.test.raises (cmdexec.Error, cmdexec, 'exit 1')