summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-03-17 14:22:34 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-03-17 14:22:34 (GMT)
commit187f93d986a571b0a7d797a3b114d5d877d261e1 (patch)
tree01b3cccd30d2d1458346d32ef9b8ec17ad55b21d /Lib
parentd80b4bfd0b291d543c682d7dac0841de0192a238 (diff)
downloadcpython-187f93d986a571b0a7d797a3b114d5d877d261e1.zip
cpython-187f93d986a571b0a7d797a3b114d5d877d261e1.tar.gz
cpython-187f93d986a571b0a7d797a3b114d5d877d261e1.tar.bz2
Use "x in y" instead of y.find(x) != -1.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_file.py2
-rw-r--r--Lib/test/test_file2k.py2
-rw-r--r--Lib/test/test_fileio.py2
-rw-r--r--Lib/test/test_minidom.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 9b6b435..c3c0def 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -172,7 +172,7 @@ class OtherFileTests(unittest.TestCase):
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.
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
index f692533..a7681a9 100644
--- a/Lib/test/test_file2k.py
+++ b/Lib/test/test_file2k.py
@@ -227,7 +227,7 @@ class OtherFileTests(unittest.TestCase):
except ValueError, 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.
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 5057941..21d231f 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -320,7 +320,7 @@ class OtherFileTests(unittest.TestCase):
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.
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index fad7f36..f160d09 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -433,7 +433,7 @@ class MinidomTest(unittest.TestCase):
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):