diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
commit | 577473fe687b38c8f01b0c372d6d2563680045b3 (patch) | |
tree | ee7dc210c7c5281cf07add09a9cb451758e91716 /Lib/test/test_cmd_line.py | |
parent | a69ba65fdce3be6f55634b47cc56cf1f962f6cbc (diff) | |
download | cpython-577473fe687b38c8f01b0c372d6d2563680045b3.zip cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.gz cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.bz2 |
use assert[Not]In where appropriate
A patch from Dave Malcolm.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r-- | Lib/test/test_cmd_line.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 852a7aa..b03a0ba 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -49,7 +49,7 @@ class CmdLineTest(unittest.TestCase): def verify_valid_flag(self, cmd_line): data = self.start_python(cmd_line) self.assertTrue(data == b'' or data.endswith(b'\n')) - self.assertTrue(b'Traceback' not in data) + self.assertNotIn(b'Traceback', data) def test_optimize(self): self.verify_valid_flag('-O') @@ -65,7 +65,7 @@ class CmdLineTest(unittest.TestCase): self.verify_valid_flag('-S') def test_usage(self): - self.assertTrue(b'usage' in self.start_python('-h')) + self.assertIn(b'usage', self.start_python('-h')) def test_version(self): version = ('Python %d.%d' % sys.version_info[:2]).encode("ascii") @@ -77,10 +77,10 @@ class CmdLineTest(unittest.TestCase): # codec), a recursion loop can occur. data, rc = self.start_python_and_exit_code('-v') self.assertEqual(rc, 0) - self.assertTrue(b'stack overflow' not in data) + self.assertNotIn(b'stack overflow', data) data, rc = self.start_python_and_exit_code('-vv') self.assertEqual(rc, 0) - self.assertTrue(b'stack overflow' not in data) + self.assertNotIn(b'stack overflow', data) def test_run_module(self): # Test expected operation of the '-m' switch @@ -166,8 +166,8 @@ class CmdLineTest(unittest.TestCase): p = _spawn_python_with_env('-S', '-c', 'import sys; print(sys.path)') stdout, _ = p.communicate() - self.assertTrue(path1.encode('ascii') in stdout) - self.assertTrue(path2.encode('ascii') in stdout) + self.assertIn(path1.encode('ascii'), stdout) + self.assertIn(path2.encode('ascii'), stdout) def test_main(): |