[Zope3-checkins] CVS: Zope3/src/zope/fssync/tests - test_fsmerger.py:1.6

Guido van Rossum guido@python.org
Wed, 28 May 2003 11:02:25 -0400


Update of /cvs-repository/Zope3/src/zope/fssync/tests
In directory cvs.zope.org:/tmp/cvs-serv5135

Modified Files:
	test_fsmerger.py 
Log Message:
Ouch.  The diff3 check wasn't working.  Make it spit out a warning
when disabling diff3 tests.


=== Zope3/src/zope/fssync/tests/test_fsmerger.py 1.5 => 1.6 ===
--- Zope3/src/zope/fssync/tests/test_fsmerger.py:1.5	Wed May 28 10:53:41 2003
+++ Zope3/src/zope/fssync/tests/test_fsmerger.py	Wed May 28 11:02:25 2003
@@ -11,12 +11,13 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""Tests for the FSMerger class.
+"""Tests for the (high-level) FSMerger class.
 
 $Id$
 """
 
 import os
+import sys
 import unittest
 
 from os.path import exists, isdir, isfile, realpath, normcase, split, join
@@ -44,14 +45,18 @@
 
     def diff3_check(self):
         if not hasattr(os, "popen"):
+            sys.stderr.write("\nos.popen() not found, diff3 tests disabled\n")
             return False
         f1 = self.tempfile("a")
-        f2 = self.tempfile("b")
+        f2 = self.tempfile("a")
         f3 = self.tempfile("b")
         pipe = os.popen("diff3 -m -E %s %s %s" % (f1, f2, f3), "r")
         output = pipe.read()
         sts = pipe.close()
-        return output == "b" and not sts
+        ok = output == "b" and not sts
+        if not ok:
+            sys.stderr.write("\ndiff3 doesn't work, diff3 tests disabled\n")
+        return ok
 
     def addfile(self, dir, path, data, entry=None):
         # Create a file or directory and write some data to it.  If