[Python-checkins] CVS: python/dist/src/Lib/test test_popen2.py,1.1,1.2
Fredrik Lundh
python-dev@python.org
2000年7月27日 00:42:45 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24366
Modified Files:
test_popen2.py
Log Message:
-- changed test to work on platforms which have os.popen
but no os.fork
Index: test_popen2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_popen2.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_popen2.py 1999年03月11日 13:26:18 1.1
--- test_popen2.py 2000年07月27日 07:42:43 1.2
***************
*** 6,14 ****
# popen2 contains its own testing routine
# which is especially useful to see if open files
! # like stdin can be read successfully by a forked
# subprocess.
def main():
! from os import fork # skips test through ImportError
import popen2
popen2._test()
--- 6,20 ----
# popen2 contains its own testing routine
# which is especially useful to see if open files
! # like stdin can be read successfully by a forked
# subprocess.
def main():
! try:
! from os import popen
! except ImportError:
! # if we don't have os.popen, check that
! # we have os.fork. if not, skip the test
! # (by raising an ImportError)
! from os import fork
import popen2
popen2._test()