summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2011-04-28 10:02:58 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2011-04-28 10:02:58 (GMT)
commite812bf7bf6b7c1826b5e2c2488176a93cc6968bc (patch)
tree955499f7168c8e072f22f165ff6fa592f28dd7fc /Lib/test/test_configparser.py
parent2ea72709a34e57c9c131d7006ea80bdefbcf7bfe (diff)
parentba702daef9a8ac03d2d2fea4b1764d38b8debbd9 (diff)
downloadcpython-e812bf7bf6b7c1826b5e2c2488176a93cc6968bc.zip
cpython-e812bf7bf6b7c1826b5e2c2488176a93cc6968bc.tar.gz
cpython-e812bf7bf6b7c1826b5e2c2488176a93cc6968bc.tar.bz2
Merged styling updates for #11670 from 3.2.
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r--Lib/test/test_configparser.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index 03e400d..299f37a 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -1316,7 +1316,7 @@ class FakeFile:
def readline_generator(f):
"""As advised in Doc/library/configparser.rst."""
line = f.readline()
- while line != '':
+ while line:
yield line
line = f.readline()
@@ -1327,8 +1327,8 @@ class ReadFileTestCase(unittest.TestCase):
parser = configparser.ConfigParser()
with open(file_path) as f:
parser.read_file(f)
- self.assertTrue("Foo Bar" in parser)
- self.assertTrue("foo" in parser["Foo Bar"])
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
self.assertEqual(parser["Foo Bar"]["foo"], "newbar")
def test_iterable(self):
@@ -1337,8 +1337,8 @@ class ReadFileTestCase(unittest.TestCase):
foo=newbar""").strip().split('\n')
parser = configparser.ConfigParser()
parser.read_file(lines)
- self.assertTrue("Foo Bar" in parser)
- self.assertTrue("foo" in parser["Foo Bar"])
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
self.assertEqual(parser["Foo Bar"]["foo"], "newbar")
def test_readline_generator(self):
@@ -1347,8 +1347,8 @@ class ReadFileTestCase(unittest.TestCase):
with self.assertRaises(TypeError):
parser.read_file(FakeFile())
parser.read_file(readline_generator(FakeFile()))
- self.assertTrue("Foo Bar" in parser)
- self.assertTrue("foo" in parser["Foo Bar"])
+ self.assertIn("Foo Bar", parser)
+ self.assertIn("foo", parser["Foo Bar"])
self.assertEqual(parser["Foo Bar"]["foo"], "newbar")