summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_range.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-23 15:40:09 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-23 15:40:09 (GMT)
commitb58e0bd8bb7592dd48b30af546fc20f52ac625bd (patch)
tree2af0b7f4177890e1781f8d38aed8ebdc44c71f39 /Lib/test/test_range.py
parent0f77f465ff7f5e39bbf701b575aebf75dd8d800d (diff)
downloadcpython-b58e0bd8bb7592dd48b30af546fc20f52ac625bd.zip
cpython-b58e0bd8bb7592dd48b30af546fc20f52ac625bd.tar.gz
cpython-b58e0bd8bb7592dd48b30af546fc20f52ac625bd.tar.bz2
use assert[Not]In where appropriate
Diffstat (limited to 'Lib/test/test_range.py')
-rw-r--r--Lib/test/test_range.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py
index d9bf5a0..812b73d 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -126,7 +126,7 @@ class RangeTest(unittest.TestCase):
class C2:
def __int__(self): return 1
def __index__(self): return 1
- self.assertFalse(C2() in range(3))
+ self.assertNotIn(C2(), range(3))
# ..except if explicitly told so.
self.assertIn(int(C2()), range(3))
@@ -140,32 +140,32 @@ class RangeTest(unittest.TestCase):
def test_strided_limits(self):
r = range(0, 101, 2)
self.assertIn(0, r)
- self.assertFalse(1 in r)
+ self.assertNotIn(1, r)
self.assertIn(2, r)
- self.assertFalse(99 in r)
+ self.assertNotIn(99, r)
self.assertIn(100, r)
- self.assertFalse(101 in r)
+ self.assertNotIn(101, r)
r = range(0, -20, -1)
self.assertIn(0, r)
self.assertIn(-1, r)
self.assertIn(-19, r)
- self.assertFalse(-20 in r)
+ self.assertNotIn(-20, r)
r = range(0, -20, -2)
self.assertIn(-18, r)
- self.assertFalse(-19 in r)
- self.assertFalse(-20 in r)
+ self.assertNotIn(-19, r)
+ self.assertNotIn(-20, r)
def test_empty(self):
r = range(0)
- self.assertFalse(0 in r)
- self.assertFalse(1 in r)
+ self.assertNotIn(0, r)
+ self.assertNotIn(1, r)
r = range(0, -10)
- self.assertFalse(0 in r)
- self.assertFalse(-1 in r)
- self.assertFalse(1 in r)
+ self.assertNotIn(0, r)
+ self.assertNotIn(-1, r)
+ self.assertNotIn(1, r)
def test_range_iterators(self):
# exercise 'fast' iterators, that use a rangeiterobject internally.