diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/_windows.py | 14 | ||||
-rw-r--r-- | test/test_memory_leaks.py | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/test/_windows.py b/test/_windows.py index f812880c..879a698c 100644 --- a/test/_windows.py +++ b/test/_windows.py @@ -526,6 +526,8 @@ class RemoteProcessTestCase(unittest.TestCase): test_args = ["-c", "import sys; sys.stdin.read()"] def setUp(self): + env = os.environ.copy() + env["THINK_OF_A_NUMBER"] = str(os.getpid()) self.proc32 = get_test_subprocess([self.python32] + self.test_args, env=env, stdin=subprocess.PIPE) @@ -560,6 +562,18 @@ class RemoteProcessTestCase(unittest.TestCase): p = psutil.Process(self.proc64.pid) self.assertEqual(p.cwd(), os.getcwd()) + def test_environ_32(self): + p = psutil.Process(self.proc32.pid) + e = p.environ() + self.assertIn("THINK_OF_A_NUMBER", e) + self.assertEquals(e["THINK_OF_A_NUMBER"], str(os.getpid())) + + def test_environ_64(self): + p = psutil.Process(self.proc64.pid) + e = p.environ() + self.assertIn("THINK_OF_A_NUMBER", e) + self.assertEquals(e["THINK_OF_A_NUMBER"], str(os.getpid())) + def main(): test_suite = unittest.TestSuite() diff --git a/test/test_memory_leaks.py b/test/test_memory_leaks.py index a43e941e..d79d5900 100644 --- a/test/test_memory_leaks.py +++ b/test/test_memory_leaks.py @@ -323,7 +323,7 @@ class TestProcessObjectLeaks(Base): s.close() @unittest.skipUnless(hasattr(psutil.Process, 'environ'), - "Linux and OSX") + "Linux, OSX and Windows") def test_environ(self): self.execute("environ") |