summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-01-06 14:28:24 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2020-01-06 14:28:24 -0800
commit6c07f48a874754f472f6c3beb7e1184ab8dab39a (patch)
tree9b1e8195252f533d73b98add735cb55c4e8d6b99
parent56525b5299d3fd2830cf479df52cb5f527aeed66 (diff)
downloadpsutil-6c07f48a874754f472f6c3beb7e1184ab8dab39a.tar.gz
fix some win tests
-rw-r--r--psutil/_psutil_windows.c2
-rw-r--r--psutil/tests/__init__.py5
-rwxr-xr-xpsutil/tests/test_windows.py2
-rwxr-xr-xscripts/internal/winmake.py2
4 files changed, 7 insertions, 4 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index 228566ac..c03324f8 100644
--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -608,7 +608,7 @@ psutil_GetProcWsetInformation(
{
HeapFree(GetProcessHeap(), 0, buffer);
bufferSize *= 2;
- psutil_debug("NtQueryVirtualMemory increase bufsize %zd", bufferSize);
+ psutil_debug("NtQueryVirtualMemory increase bufsize %i", bufferSize);
// Fail if we're resizing the buffer to something very large.
if (bufferSize > 256 * 1024 * 1024) {
PyErr_SetString(PyExc_RuntimeError,
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index a4dc499a..3931f1c6 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -453,7 +453,10 @@ def sh(cmd, **kwds):
kwds.setdefault("creationflags", flags)
p = subprocess.Popen(cmd, **kwds)
_subprocesses_started.add(p)
- stdout, stderr = p.communicate()
+ if PY3:
+ stdout, stderr = p.communicate(timeout=GLOBAL_TIMEOUT)
+ else:
+ stdout, stderr = p.communicate()
if p.returncode != 0:
raise RuntimeError(stderr)
if stderr:
diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py
index de12ff50..de41aed8 100755
--- a/psutil/tests/test_windows.py
+++ b/psutil/tests/test_windows.py
@@ -210,7 +210,7 @@ class TestSystemAPIs(unittest.TestCase):
wmi_btime_str, "%Y%m%d%H%M%S")
psutil_dt = datetime.datetime.fromtimestamp(psutil.boot_time())
diff = abs((wmi_btime_dt - psutil_dt).total_seconds())
- self.assertLessEqual(diff, 1)
+ self.assertLessEqual(diff, 3)
def test_boot_time_fluctuation(self):
# https://github.com/giampaolo/psutil/issues/1007
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py
index fd9e7739..69a1bfbe 100755
--- a/scripts/internal/winmake.py
+++ b/scripts/internal/winmake.py
@@ -529,7 +529,7 @@ def get_python(path):
def main():
- global PYYHON
+ global PYTHON
parser = argparse.ArgumentParser()
# option shared by all commands
parser.add_argument(