summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-05-17 02:47:52 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-05-17 02:47:52 +0200
commitcb51168c942fcbfea194191cc7e318283fb8dde2 (patch)
tree3ad7d3e50f258d1d0cf1e6797fcac43541b3fbb2
parent609a02a11a0f9f5c5a2fd3d77386c6b72b31e564 (diff)
downloadpsutil-cb51168c942fcbfea194191cc7e318283fb8dde2.tar.gz
pass cwd and env to get_test_subprocess; reason: try to figure this out https://travis-ci.org/giampaolo/psutil/jobs/233019876
-rw-r--r--psutil/tests/__init__.py2
-rwxr-xr-xpsutil/tests/test_connections.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 1a0e168b..b329d0ff 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -271,6 +271,8 @@ def get_test_subprocess(cmd=None, **kwds):
"""
kwds.setdefault("stdin", DEVNULL)
kwds.setdefault("stdout", DEVNULL)
+ kwds.setdefault("cwd", os.getcwd())
+ kwds.setdefault("env", os.environ)
if WINDOWS:
# Prevents the subprocess to open error dialogs.
kwds.setdefault("creationflags", 0x8000000) # CREATE_NO_WINDOW
diff --git a/psutil/tests/test_connections.py b/psutil/tests/test_connections.py
index f7dd2ec2..c4d896ee 100755
--- a/psutil/tests/test_connections.py
+++ b/psutil/tests/test_connections.py
@@ -465,7 +465,7 @@ class TestSystemWideConnections(unittest.TestCase):
pids = []
times = 10
for i in range(times):
- fname = TESTFN + str(i)
+ fname = os.path.realpath(TESTFN) + str(i)
src = textwrap.dedent("""\
import time, os
from psutil.tests import create_sockets