[Python-checkins] CVS: python/dist/src/Lib/test test_fork1.py,1.7,1.8 test_popen2.py,1.4,1.5

Moshe Zadka moshez@users.sourceforge.net
Tue, 30 Jan 2001 10:35:34 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv20661/Lib/test

Modified Files:
	test_fork1.py test_popen2.py 
Log Message:
Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.
Tested for not breaking builds on Linux.


Index: test_fork1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_fork1.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_fork1.py	2001/01/17 19:11:13	1.7
--- test_fork1.py	2001/01/30 18:35:32	1.8
***************
*** 7,23 ****
  active threads survive in the child after a fork(); this is an error.
  
! On BeOS, you CANNOT mix threads and fork(), the behaviour is undefined.
! That's OK, fork() is a grotesque hack anyway. ;-) [cjh]
! 
  """
  
  import os, sys, time, thread
  from test_support import verify, verbose, TestSkipped
- 
- try:
-     if os.uname()[0] == "BeOS":
-         raise TestSkipped, "can't mix os.fork with threads on BeOS"
- except AttributeError:
-     pass
  
  try:
--- 7,16 ----
  active threads survive in the child after a fork(); this is an error.
  
! While BeOS doesn't officially support fork and native threading in
! the same application, the present example should work just fine.  DC
  """
  
  import os, sys, time, thread
  from test_support import verify, verbose, TestSkipped
  
  try:

Index: test_popen2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_popen2.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_popen2.py	2000/09/01 20:38:55	1.4
--- test_popen2.py	2001/01/30 18:35:32	1.5
***************
*** 5,8 ****
--- 5,10 ----
  
  import os
+ import sys
+ from test_support import TestSkipped
  
  # popen2 contains its own testing routine
***************
*** 13,16 ****
--- 15,23 ----
  def main():
      print "Test popen2 module:"
+     if sys.platform[:4] == 'beos' and __name__ != '__main__':
+         #  Locks get messed up or something.  Generally we're supposed
+         #  to avoid mixing "posix" fork & exec with native threads, and
+         #  they may be right about that after all.
+         raise TestSkipped, "popen2() doesn't work during import on BeOS"
      try:
          from os import popen