Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/test/test_popen2.py

    r2 r391  
    1313import popen2
    1414
    15 from test.test_support import TestSkipped, run_unittest, reap_children
     15from test.test_support import run_unittest, reap_children
    1616
    1717if sys.platform[:4] == 'beos' or sys.platform[:6] == 'atheos':
     
    1919    #  to avoid mixing "posix" fork & exec with native threads, and
    2020    #  they may be right about that after all.
    21     raise TestSkipped("popen2() doesn't work on " + sys.platform)
     21    raise unittest.SkipTest("popen2() doesn't work on " + sys.platform)
    2222
    2323# if we don't have os.popen, check that
     
    5151            inst.wait()
    5252        popen2._cleanup()
    53         self.assertFalse(popen2._active, "_active not empty")
     53        self.assertFalse(popen2._active, "popen2._active not empty")
     54        # The os.popen*() API delegates to the subprocess module (on Unix)
     55        import subprocess
     56        for inst in subprocess._active:
     57            inst.wait()
     58        subprocess._cleanup()
     59        self.assertFalse(subprocess._active, "subprocess._active not empty")
    5460        reap_children()
    5561
     
    5864        w.close()
    5965        got = r.read()
    60         self.assertEquals(expected_out, got.strip(), "wrote %r read %r" %
    61                           (teststr, got))
     66        self.assertEqual(expected_out, got.strip(), "wrote %r read %r" %
     67                         (teststr, got))
    6268
    6369        if e is not None:
     
    8591            w, r = os.popen2(["echo", self.teststr])
    8692            got = r.read()
    87             self.assertEquals(got, self.teststr + "\n")
     93            self.assertEqual(got, self.teststr + "\n")
    8894
    8995        w, r = os.popen2(self.cmd)
     
    98104            w, r, e = os.popen3(["echo", self.teststr])
    99105            got = r.read()
    100             self.assertEquals(got, self.teststr + "\n")
     106            self.assertEqual(got, self.teststr + "\n")
    101107            got = e.read()
    102108            self.assertFalse(got, "unexpected %r on stderr" % got)
     
    112118            w, r = os.popen4(["echo", self.teststr])
    113119            got = r.read()
    114             self.assertEquals(got, self.teststr + "\n")
     120            self.assertEqual(got, self.teststr + "\n")
    115121
    116122        w, r = os.popen4(self.cmd)
Note: See TracChangeset for help on using the changeset viewer.