[Python-checkins] r79048 - in python/branches/py3k: Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_minidom.py

ezio.melotti python-checkins at python.org
Thu Mar 18 13:29:13 CET 2010


Author: ezio.melotti
Date: Thu Mar 18 13:29:13 2010
New Revision: 79048
Log:
Merged revisions 79024 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r79024 | ezio.melotti | 2010年03月17日 16:22:34 +0200 (2010年3月17日) | 1 line
 
 Use "x in y" instead of y.find(x) != -1.
........
Modified:
 python/branches/py3k/ (props changed)
 python/branches/py3k/Lib/test/test_file.py
 python/branches/py3k/Lib/test/test_fileio.py
 python/branches/py3k/Lib/test/test_minidom.py
Modified: python/branches/py3k/Lib/test/test_file.py
==============================================================================
--- python/branches/py3k/Lib/test/test_file.py	(original)
+++ python/branches/py3k/Lib/test/test_file.py	Thu Mar 18 13:29:13 2010
@@ -166,7 +166,7 @@
 except ValueError as msg:
 if msg.args[0] != 0:
 s = str(msg)
- if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
+ if TESTFN in s or bad_mode not in s:
 self.fail("bad error message for invalid mode: %s" % s)
 # if msg.args[0] == 0, we're probably on Windows where there may be
 # no obvious way to discover why open() failed.
Modified: python/branches/py3k/Lib/test/test_fileio.py
==============================================================================
--- python/branches/py3k/Lib/test/test_fileio.py	(original)
+++ python/branches/py3k/Lib/test/test_fileio.py	Thu Mar 18 13:29:13 2010
@@ -318,7 +318,7 @@
 except ValueError as msg:
 if msg.args[0] != 0:
 s = str(msg)
- if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
+ if TESTFN in s or bad_mode not in s:
 self.fail("bad error message for invalid mode: %s" % s)
 # if msg.args[0] == 0, we're probably on Windows where there may be
 # no obvious way to discover why open() failed.
Modified: python/branches/py3k/Lib/test/test_minidom.py
==============================================================================
--- python/branches/py3k/Lib/test/test_minidom.py	(original)
+++ python/branches/py3k/Lib/test/test_minidom.py	Thu Mar 18 13:29:13 2010
@@ -432,7 +432,7 @@
 string1 = repr(el)
 string2 = str(el)
 self.confirm(string1 == string2)
- self.confirm(string1.find("slash:abc") != -1)
+ self.confirm("slash:abc" in string1)
 dom.unlink()
 
 def testAttributeRepr(self):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /